summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-04-28 08:16:04 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-04-28 08:17:50 (GMT)
commit0f0dbd09f7bf2ef9d69d1e559ace961d9b236d3b (patch)
treecfac297a168e6420e6e2f9007534ff59972d9641 /tests
parent30087926ae942decd80632fbbb06eb389a343fac (diff)
downloadQt-0f0dbd09f7bf2ef9d69d1e559ace961d9b236d3b.zip
Qt-0f0dbd09f7bf2ef9d69d1e559ace961d9b236d3b.tar.gz
Qt-0f0dbd09f7bf2ef9d69d1e559ace961d9b236d3b.tar.bz2
When minimizing/restoring an item view it could jump to its currently
selected item Task-number: 250446 Reviewed-by: ogoffart
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qlistview/tst_qlistview.cpp28
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"