summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-11-16 08:25:06 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-11-16 08:27:56 (GMT)
commit07b9a2f2f74a42c83ac95f144392437001a455bb (patch)
treeacdd8c136a663212de6f44b40e31ac7188cd9bb6
parent0aba1250db9ac414fbe4b0fed9fcba713bf5a619 (diff)
downloadQt-07b9a2f2f74a42c83ac95f144392437001a455bb.zip
Qt-07b9a2f2f74a42c83ac95f144392437001a455bb.tar.gz
Qt-07b9a2f2f74a42c83ac95f144392437001a455bb.tar.bz2
Fix regression due to 6cf397f7ac35a058096528a7ad8bfaf623b30747
PathView needed to update internal item count when delegate was set. VDM::count() didn't call into the internal VDM when querying count. Task-number: QTBUG-14781 Reviewed-by: Alan Alpert
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview.cpp1
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp2
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();