diff options
author | Martin Jones <martin.jones@nokia.com> | 2011-01-06 05:48:52 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2011-01-06 05:55:00 (GMT) |
commit | 1ba3e41f09ea719249286fede5d3fe96621ccb61 (patch) | |
tree | fca572fbeea4ad92aa1d0fdd7172098a9bcca873 /src | |
parent | 1d7b672fd46abab51a0124ad19aad18e5d14f1a8 (diff) | |
download | Qt-1ba3e41f09ea719249286fede5d3fe96621ccb61.zip Qt-1ba3e41f09ea719249286fede5d3fe96621ccb61.tar.gz Qt-1ba3e41f09ea719249286fede5d3fe96621ccb61.tar.bz2 |
PathView: update modelCount before attempting to regenerate delegates.
If the model is a VisualDataModel, the count will initally be zero
and modelCount is not updated due to itemsInserted() before the
component is completed.
Task-number: QTBUG-16357
Reviewed-by: Bea Lam
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativepathview.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp index e3987d0..74d3418 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview.cpp +++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp @@ -1318,8 +1318,10 @@ void QDeclarativePathView::componentComplete() // It is possible that a refill has already happended to to Path // bindings being handled in the componentComplete(). If so // don't do it again. - if (d->items.count() == 0) + if (d->items.count() == 0 && d->model) { + d->modelCount = d->model->count(); d->regenerate(); + } d->updateHighlight(); } |