summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-12-10 05:34:52 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-12-10 05:34:52 (GMT)
commit1de4983c86a73913bd2d719ad765726530009979 (patch)
tree7f311f426f9a8b97c094f9e5af74ec0f70245094 /src/declarative
parenta0fabfac2ddd0b4e52a1d06623a0864f836cba71 (diff)
downloadQt-1de4983c86a73913bd2d719ad765726530009979.zip
Qt-1de4983c86a73913bd2d719ad765726530009979.tar.gz
Qt-1de4983c86a73913bd2d719ad765726530009979.tar.bz2
PathView: removing the currentIndex could make it invalid.
Removing the currentIndex could result in currentIndex being > than the number of items in the model. Task-number: QTBUG-15926 Reviewed-by: Michael Brasser
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp
index 7c79afe..87ea214 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp
@@ -1478,7 +1478,7 @@ void QDeclarativePathView::itemsRemoved(int modelIndex, int count)
currentChanged = true;
} else if (d->currentIndex >= modelIndex && d->currentIndex < modelIndex + count) {
// current item has been removed.
- d->currentIndex = qMin(modelIndex, d->modelCount-1);
+ d->currentIndex = qMin(modelIndex, d->modelCount-count-1);
if (d->currentItem) {
if (QDeclarativePathViewAttached *att = d->attached(d->currentItem))
att->setIsCurrentItem(true);