summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativegridview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativegridview.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index 29c714d..feca6b5 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -2852,6 +2852,11 @@ void QDeclarativeGridView::itemsInserted(int modelIndex, int count)
addedVisible = true;
}
FxGridItem *item = d->createItem(modelIndex + i);
+ if (!item) {
+ // broken or no delegate
+ d->clear();
+ return;
+ }
d->visibleItems.insert(index, item);
item->setPosition(colPos, rowPos);
added.append(item);
@@ -3042,6 +3047,11 @@ void QDeclarativeGridView::itemsMoved(int from, int to, int count)
FxGridItem *movedItem = moved.take(item->index);
if (!movedItem)
movedItem = d->createItem(item->index);
+ if (!movedItem) {
+ // broken or no delegate
+ d->clear();
+ return;
+ }
it = d->visibleItems.insert(it, movedItem);
if (it == d->visibleItems.begin() && firstItem)
movedItem->setPosition(firstItem->colPos(), firstItem->rowPos());