diff options
author | Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> | 2015-09-04 13:31:43 +0200 |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> | 2015-09-05 16:55:47 +0000 |
commit | 7ee93972d0f907725ad47f9a08b65a14ca48e9c0 (patch) | |
tree | 16740ab2b77de153f289d85ade1e80ecc01b8627 /tests/auto/quick/qquicklistview/tst_qquicklistview.cpp | |
parent | cef14c0ff9a0caaa5b65ab89825534b3fcbd4764 (diff) |
Item views: Don't emit 'currentItemChanged' if the current item didn't really change
Change-Id: I8892bb9b6ab6737d4a6f6f8aab836f863668682e
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'tests/auto/quick/qquicklistview/tst_qquicklistview.cpp')
-rw-r--r-- | tests/auto/quick/qquicklistview/tst_qquicklistview.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp index 472ffdc4b6..8e7f93849c 100644 --- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp +++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp @@ -2718,9 +2718,12 @@ void tst_QQuickListView::currentIndex() QTRY_COMPARE(listview->highlightItem()->y(), hlPos); // insert item before currentIndex + window->rootObject()->setProperty("currentItemChangedCount", QVariant(0)); listview->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; listview->setCurrentIndex(-1); |