aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2012-02-03 10:55:19 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-07 01:15:25 +0100
commit201edf3a34c7a69f5ab905c286ab12b975cdc3da (patch)
treee86369415b0ecf3685c58c4ab18d6e4701e7af45 /tests/auto
parent41462816074b3309efa31febf224120aa66237df (diff)
Section header is not made visible when changing currentIndex.
Make section header visible when setting currentIndex to an item on a section boundary. Could also affect initial position if view size started at 0. Change-Id: Ie65f91826311d34a290d369d8956f1c88f7efb70 Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qtquick2/qquicklistview/tst_qquicklistview.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/qtquick2/qquicklistview/tst_qquicklistview.cpp b/tests/auto/qtquick2/qquicklistview/tst_qquicklistview.cpp
index 9dd72aeeaf..3915d13de5 100644
--- a/tests/auto/qtquick2/qquicklistview/tst_qquicklistview.cpp
+++ b/tests/auto/qtquick2/qquicklistview/tst_qquicklistview.cpp
@@ -2118,6 +2118,13 @@ void tst_QQuickListView::sectionsDelegate()
QTRY_COMPARE(item->y(), qreal(i*20*6));
}
+ // ensure section header is maintained in view
+ listview->setCurrentIndex(20);
+ QTRY_VERIFY(listview->contentY() >= 200.0);
+ listview->setCurrentIndex(0);
+ QTRY_COMPARE(listview->contentY(), 0.0);
+
+ // change section
model.modifyItem(0, "One", "aaa");
model.modifyItem(1, "Two", "aaa");
model.modifyItem(2, "Three", "aaa");