diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-12-10 05:34:52 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-12-10 05:34:52 (GMT) |
commit | 1de4983c86a73913bd2d719ad765726530009979 (patch) | |
tree | 7f311f426f9a8b97c094f9e5af74ec0f70245094 /src | |
parent | a0fabfac2ddd0b4e52a1d06623a0864f836cba71 (diff) | |
download | Qt-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')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativepathview.cpp | 2 |
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); |