diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-09-06 10:39:42 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-09-06 10:39:51 +0200 |
commit | 68607aeeeb6ba84b843a0e3d848a5438a36f55a7 (patch) | |
tree | f7ff7ef369e079599d8be73f909498aeb6e75201 /tests/auto/quick/qquickgridview | |
parent | a719e348d22b1ce158a7b2be878965ac3a258914 (diff) | |
parent | 42f58e557034bb95005db465f078212cfc1b693a (diff) |
Merge remote-tracking branch 'origin/5.6' into dev
Change-Id: Id27c36e55fcc68cc1140b0d9bec00b8ae6b52ed0
Diffstat (limited to 'tests/auto/quick/qquickgridview')
-rw-r--r-- | tests/auto/quick/qquickgridview/data/gridview-initCurrent.qml | 3 | ||||
-rw-r--r-- | tests/auto/quick/qquickgridview/tst_qquickgridview.cpp | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickgridview/data/gridview-initCurrent.qml b/tests/auto/quick/qquickgridview/data/gridview-initCurrent.qml index af35d2fa1b..0a6184c9de 100644 --- a/tests/auto/quick/qquickgridview/data/gridview-initCurrent.qml +++ b/tests/auto/quick/qquickgridview/data/gridview-initCurrent.qml @@ -6,6 +6,7 @@ Rectangle { property int current: grid.currentIndex property bool showHeader: false property bool showFooter: false + property int currentItemChangedCount: 0 width: 240 height: 320 @@ -63,5 +64,7 @@ Rectangle { model: testModel header: root.showHeader ? headerFooter : null footer: root.showFooter ? headerFooter : null + + onCurrentItemChanged: { root.currentItemChangedCount++ } } } diff --git a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp index 87042ca7ba..3699bef56d 100644 --- a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp +++ b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp @@ -1886,9 +1886,12 @@ void tst_QQuickGridView::currentIndex() QTRY_COMPARE(gridview->highlightItem()->y(), hlPosY); // insert item before currentIndex + window->rootObject()->setProperty("currentItemChangedCount", QVariant(0)); gridview->setCurrentIndex(28); + QTRY_COMPARE(window->rootObject()->property("currentItemChangedCount").toInt(), 1); model.insertItem(0, "Foo", "1111"); QTRY_COMPARE(window->rootObject()->property("current").toInt(), 29); + QCOMPARE(window->rootObject()->property("currentItemChangedCount").toInt(), 1); // check removing highlight by setting currentIndex to -1; gridview->setCurrentIndex(-1); |