diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-11-16 05:59:56 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-11-16 05:59:56 (GMT) |
commit | 6cf397f7ac35a058096528a7ad8bfaf623b30747 (patch) | |
tree | d9069d508c29600f7a61621c6f133268b8ad0ad3 /src/declarative | |
parent | d02e604cc4d7999cc710b4572edb34236cc70800 (diff) | |
download | Qt-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.cpp | 2 |
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(); } |