diff options
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativepathview.cpp | 1 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp index e6eaa2f..7c79afe 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview.cpp +++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp @@ -1011,6 +1011,7 @@ void QDeclarativePathView::setDelegate(QDeclarativeComponent *delegate) } if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model)) { dataModel->setDelegate(delegate); + d->modelCount = dataModel->count(); d->regenerate(); emit delegateChanged(); } diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp index 9601db0..4fe6c4c 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp @@ -937,6 +937,8 @@ void QDeclarativeVisualDataModel::setPart(const QString &part) int QDeclarativeVisualDataModel::count() const { Q_D(const QDeclarativeVisualDataModel); + if (d->m_visualItemModel) + return d->m_visualItemModel->count(); if (!d->m_delegate) return 0; return d->modelCount(); |