diff options
author | Jarek Kobus <jkobus@trolltech.com> | 2009-04-29 12:48:46 (GMT) |
---|---|---|
committer | Jarek Kobus <jkobus@trolltech.com> | 2009-04-29 12:48:46 (GMT) |
commit | d51939831552ef73e8f33365c1ef77322594512c (patch) | |
tree | 5661175cbee710d723491f5eadf43b9016ea3e09 /tests/auto/qlistview/tst_qlistview.cpp | |
parent | 77a0de016ed8afc60a3d8b961b65b94b37d87036 (diff) | |
parent | 660907a80e8a3f23f70cd5039407c0cc679af9f3 (diff) | |
download | Qt-d51939831552ef73e8f33365c1ef77322594512c.zip Qt-d51939831552ef73e8f33365c1ef77322594512c.tar.gz Qt-d51939831552ef73e8f33365c1ef77322594512c.tar.bz2 |
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt into 4.5
Diffstat (limited to 'tests/auto/qlistview/tst_qlistview.cpp')
-rw-r--r-- | tests/auto/qlistview/tst_qlistview.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/qlistview/tst_qlistview.cpp b/tests/auto/qlistview/tst_qlistview.cpp index 2e7f412..c372475 100644 --- a/tests/auto/qlistview/tst_qlistview.cpp +++ b/tests/auto/qlistview/tst_qlistview.cpp @@ -105,6 +105,7 @@ private slots: void task203585_selectAll(); void task228566_infiniteRelayout(); void task248430_crashWith0SizedItem(); + void task250446_scrollChanged(); }; // Testing get/set functions @@ -1528,5 +1529,32 @@ void tst_QListView::task248430_crashWith0SizedItem() QTest::qWait(100); } +void tst_QListView::task250446_scrollChanged() +{ + QStandardItemModel model(200, 1); + QListView view; + view.setModel(&model); + QModelIndex index = model.index(0, 0); + QVERIFY(index.isValid()); + view.setCurrentIndex(index); + view.show(); + QTest::qWait(100); + const int scrollValue = view.verticalScrollBar()->maximum(); + view.verticalScrollBar()->setValue(scrollValue); + QCOMPARE(view.verticalScrollBar()->value(), scrollValue); + QCOMPARE(view.currentIndex(), index); + + view.showMinimized(); + QTest::qWait(100); + QCOMPARE(view.verticalScrollBar()->value(), scrollValue); + QCOMPARE(view.currentIndex(), index); + + view.showNormal(); + QTest::qWait(100); + QCOMPARE(view.verticalScrollBar()->value(), scrollValue); + QCOMPARE(view.currentIndex(), index); +} + + QTEST_MAIN(tst_QListView) #include "tst_qlistview.moc" |