diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-11-04 02:38:48 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-11-04 02:38:48 (GMT) |
commit | 15c19e46a330a20700f9dd42162100a12d80dc57 (patch) | |
tree | 6eaf9bba81d7a844f2b9e78afc639a26f27aa14b | |
parent | 25e7b091c44c1cff2f74551a0603e85b4c286260 (diff) | |
download | Qt-15c19e46a330a20700f9dd42162100a12d80dc57.zip Qt-15c19e46a330a20700f9dd42162100a12d80dc57.tar.gz Qt-15c19e46a330a20700f9dd42162100a12d80dc57.tar.bz2 |
Test inserting items outside of the visible area.
-rw-r--r-- | tests/auto/declarative/listview/tst_listview.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/declarative/listview/tst_listview.cpp b/tests/auto/declarative/listview/tst_listview.cpp index 441138b..e61dd55 100644 --- a/tests/auto/declarative/listview/tst_listview.cpp +++ b/tests/auto/declarative/listview/tst_listview.cpp @@ -356,6 +356,26 @@ void tst_QmlGraphicsListView::inserted() QVERIFY(item->y() == i*20); } + for (int i = model.count(); i < 30; ++i) + model.insertItem(i, "Hello", QString::number(i)); + QTest::qWait(1000); + + listview->setViewportY(80); + QTest::qWait(1000); + + // Insert item outside visible area + model.insertItem(1, "Hello", "1324"); + QTest::qWait(1000); + + QVERIFY(listview->viewportY() == 80); + + // Confirm items positioned correctly + int itemCount = findItems<QmlGraphicsItem>(viewport, "wrapper").count() - 1; + for (int i = 5; i < 5+itemCount; ++i) { + QmlGraphicsItem *item = findItem<QmlGraphicsItem>(viewport, "wrapper", i); + QVERIFY(item->y() == i*20 - 20); + } + delete canvas; } |