summaryrefslogtreecommitdiffstats
path: root/tests/auto/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 /tests/auto/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 'tests/auto/declarative')
-rw-r--r--tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
index a2a5363..9193707 100644
--- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
+++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
@@ -429,6 +429,10 @@ void tst_QDeclarativePathView::dataModel()
pathview->setOffset(0);
QCOMPARE(findItems<QDeclarativeItem>(pathview, "wrapper").count(), 5);
+ pathview->setCurrentIndex(model.count()-1);
+ model.removeItem(model.count()-1);
+ QCOMPARE(pathview->currentIndex(), model.count()-1);
+
delete canvas;
}