summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-08-05 02:39:57 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-08-05 02:39:57 (GMT)
commite5071275f719ec36ff5e14b1e92258f270ef22b6 (patch)
tree00c8c459c2bdbf438a35e5087250319d4766fe29 /src
parent5749421fdaff0305d217712e3174c85a76b367c4 (diff)
parent5a98d58c1ed78262c20b05aa178a92b4a1a097df (diff)
downloadQt-e5071275f719ec36ff5e14b1e92258f270ef22b6.zip
Qt-e5071275f719ec36ff5e14b1e92258f270ef22b6.tar.gz
Qt-e5071275f719ec36ff5e14b1e92258f270ef22b6.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Fix crash when all visible items inluding currentIndex have been removed.
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 82b3e1c..e1dd1c0 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -1021,7 +1021,7 @@ void QDeclarativeListViewPrivate::updateCurrent(int modelIndex)
if (oldCurrentItem && (!currentItem || oldCurrentItem->item != currentItem->item))
oldCurrentItem->attached->setIsCurrentItem(false);
if (currentItem) {
- if (modelIndex == visibleIndex - 1) {
+ if (modelIndex == visibleIndex - 1 && visibleItems.count()) {
// We can calculate exact postion in this case
currentItem->setPosition(visibleItems.first()->position() - currentItem->size() - spacing);
} else {