summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-11-16 05:59:56 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-11-16 05:59:56 (GMT)
commit6cf397f7ac35a058096528a7ad8bfaf623b30747 (patch)
treed9069d508c29600f7a61621c6f133268b8ad0ad3 /src/declarative
parentd02e604cc4d7999cc710b4572edb34236cc70800 (diff)
downloadQt-6cf397f7ac35a058096528a7ad8bfaf623b30747.zip
Qt-6cf397f7ac35a058096528a7ad8bfaf623b30747.tar.gz
Qt-6cf397f7ac35a058096528a7ad8bfaf623b30747.tar.bz2
VisualDataModel::count should be 0 until a valid delegate is set.
There are no visual items if there is no delegate. Task-number: QTBUG-14781 Reviewed-by: Robert Griebl
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
index 1f01a45..9601db0 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_delegate)
+ return 0;
return d->modelCount();
}