aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2012-03-07 15:26:33 +1000
committerQt by Nokia <qt-info@nokia.com>2012-03-07 08:42:21 +0100
commitb1a301884bb88ff62268437f436d6f0fc38efe2b (patch)
tree8278b5519a599d96dfdd85a755f746378eb43f45 /tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
parent22a53bcd69d39a5ea128d53231e9e51455a98cc4 (diff)
ListView can freeze if flicked beyond its bounds.
If the delegate's size changes in componentComplete and all items are flicked out of view, an incorrect jump calculation in addVisibleItems() resulted in a new delegate being created in the wrong position, and retriggering the jump calculation, which resulted in a new delegate being created in the wrong position, and retriggering the jump... Also fixed currentItem visibility. Change-Id: Iad5f211c4fc5eed9c009d51a0ce3b58181a7b36e Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'tests/auto/quick/qquickgridview/tst_qquickgridview.cpp')
-rw-r--r--tests/auto/quick/qquickgridview/tst_qquickgridview.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
index 0171872aab..66c98cda84 100644
--- a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
+++ b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
@@ -1773,6 +1773,12 @@ void tst_QQuickGridView::currentIndex()
QVERIFY(!gridview->highlightItem());
QVERIFY(!gridview->currentItem());
+ // moving currentItem out of view should make it invisible
+ gridview->setCurrentIndex(0);
+ QTRY_VERIFY(gridview->currentItem()->isVisible());
+ gridview->setContentY(200);
+ QTRY_VERIFY(!gridview->currentItem()->isVisible());
+
delete canvas;
}