summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
index 2938f51..15348ed 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
@@ -830,7 +830,7 @@ void QDeclarativeVisualDataModel::setDelegate(QDeclarativeComponent *delegate)
\code
// view.qml
- import Qt 4.6
+ import Qt 4.7
ListView {
width: 200
@@ -1152,6 +1152,8 @@ void QDeclarativeVisualDataModel::_q_itemsChanged(int index, int count,
void QDeclarativeVisualDataModel::_q_itemsInserted(int index, int count)
{
Q_D(QDeclarativeVisualDataModel);
+ if (!count)
+ return;
// XXX - highly inefficient
QHash<int,QDeclarativeVisualDataModelPrivate::ObjectRef> items;
for (QHash<int,QDeclarativeVisualDataModelPrivate::ObjectRef>::Iterator iter = d->m_cache.begin();
@@ -1179,6 +1181,8 @@ void QDeclarativeVisualDataModel::_q_itemsInserted(int index, int count)
void QDeclarativeVisualDataModel::_q_itemsRemoved(int index, int count)
{
Q_D(QDeclarativeVisualDataModel);
+ if (!count)
+ return;
// XXX - highly inefficient
QHash<int, QDeclarativeVisualDataModelPrivate::ObjectRef> items;
for (QHash<int, QDeclarativeVisualDataModelPrivate::ObjectRef>::Iterator iter = d->m_cache.begin();