summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-11-18 05:53:08 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-11-18 05:53:08 (GMT)
commitf93cc8dda10c7f6a7a408d818ecafda23150e20c (patch)
treeb4adb77d857f8c4f61ae86ff55599b737f68a526 /src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp
parenteaa5d6d945b5bcab2cbdce01a0780ccdadbd2719 (diff)
downloadQt-f93cc8dda10c7f6a7a408d818ecafda23150e20c.zip
Qt-f93cc8dda10c7f6a7a408d818ecafda23150e20c.tar.gz
Qt-f93cc8dda10c7f6a7a408d818ecafda23150e20c.tar.bz2
ListView tests and fixes.
Diffstat (limited to 'src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp')
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp b/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp
index cf5fc5e..e8ee196 100644
--- a/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp
@@ -692,11 +692,16 @@ QmlComponent *QmlGraphicsVisualDataModel::delegate() const
void QmlGraphicsVisualDataModel::setDelegate(QmlComponent *delegate)
{
Q_D(QmlGraphicsVisualDataModel);
+ bool wasValid = d->m_delegate != 0;
d->m_delegate = delegate;
- if (d->modelCount()) {
+ if (!wasValid && d->modelCount() && d->m_delegate) {
emit itemsInserted(0, d->modelCount());
emit countChanged();
}
+ if (wasValid && !d->m_delegate && d->modelCount()) {
+ emit itemsRemoved(0, d->modelCount());
+ emit countChanged();
+ }
}
QString QmlGraphicsVisualDataModel::part() const