summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@nokia.com>2011-10-31 14:03:00 (GMT)
committerLiang Qi <liang.qi@nokia.com>2011-10-31 14:03:00 (GMT)
commit8da9881989ca55f7d5e9e74c91e3abc98ce8a1b5 (patch)
treef8ea3bac554266d7f74cf5495dc2de4c6a524c58 /src/declarative
parentcf5695691682957b68b67fd951addf4a52bfba84 (diff)
parentda8a056dbb0e4b0a65d94857cdd65ddcb8633341 (diff)
downloadQt-8da9881989ca55f7d5e9e74c91e3abc98ce8a1b5.zip
Qt-8da9881989ca55f7d5e9e74c91e3abc98ce8a1b5.tar.gz
Qt-8da9881989ca55f7d5e9e74c91e3abc98ce8a1b5.tar.bz2
Merge remote-tracking branch 'origin/4.7' into qt-4.8-from-4.7
Conflicts: doc/src/declarative/declarativeui.qdoc doc/src/mainpage.qdoc doc/src/platforms/supported-platforms.qdoc doc/src/qt-webpages.qdoc src/network/access/qnetworkdiskcache.cpp
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp10
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp15
2 files changed, 25 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index 0a74910..16518f4 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -2855,6 +2855,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);
@@ -3045,6 +3050,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());
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 7638b2b..7b4dc5c 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -3285,6 +3285,11 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count)
addedVisible = true;
}
FxListItem *item = d->createItem(modelIndex + i);
+ if (!item) {
+ // broken or no delegate
+ d->clear();
+ return;
+ }
d->visibleItems.insert(insertionIdx, item);
pos -= item->size() + d->spacing;
item->setPosition(pos);
@@ -3315,6 +3320,11 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count)
addedVisible = true;
}
FxListItem *item = d->createItem(modelIndex + i);
+ if (!item) {
+ // broken or no delegate
+ d->clear();
+ return;
+ }
d->visibleItems.insert(index, item);
item->setPosition(pos);
added.append(item);
@@ -3518,6 +3528,11 @@ void QDeclarativeListView::itemsMoved(int from, int to, int count)
FxListItem *movedItem = moved.take(item->index);
if (!movedItem)
movedItem = d->createItem(item->index);
+ if (!movedItem) {
+ // broken or no delegate
+ d->clear();
+ return;
+ }
if (item->index <= firstVisible->index)
moveBy -= movedItem->size();
it = d->visibleItems.insert(it, movedItem);