diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qtquick2/qquickgridview/tst_qquickgridview.cpp | 20 | ||||
-rw-r--r-- | tests/auto/qtquick2/qquicklistview/tst_qquicklistview.cpp | 21 |
2 files changed, 41 insertions, 0 deletions
diff --git a/tests/auto/qtquick2/qquickgridview/tst_qquickgridview.cpp b/tests/auto/qtquick2/qquickgridview/tst_qquickgridview.cpp index e2bcbfd420..132fa5fad3 100644 --- a/tests/auto/qtquick2/qquickgridview/tst_qquickgridview.cpp +++ b/tests/auto/qtquick2/qquickgridview/tst_qquickgridview.cpp @@ -1302,6 +1302,26 @@ void tst_QQuickGridView::moved_data() << 0 << 6 << 3 << 60.0; // top row moved and shifted to below 3rd row, all items should shift down by 1 row + QTest::newRow("move multiple forwards, mix of non-visible/visible") + << 120.0 + << 3 << 16 << 6 + << 60.0; // top two rows removed, third row is now the first visible + + QTest::newRow("move multiple forwards, to bottom of view") + << 0.0 + << 5 << 13 << 5 + << 0.0; + + QTest::newRow("move multiple forwards, to bottom of view, first row -> last") + << 0.0 + << 0 << 15 << 3 + << 0.0; + + QTest::newRow("move multiple forwards, to bottom of view, content y not 0") + << 120.0 + << 5+4 << 13+4 << 5 + << 0.0; + QTest::newRow("move multiple forwards, from visible -> non-visible") << 0.0 << 1 << 16 << 3 diff --git a/tests/auto/qtquick2/qquicklistview/tst_qquicklistview.cpp b/tests/auto/qtquick2/qquicklistview/tst_qquicklistview.cpp index e165e7ed73..1953cf7e73 100644 --- a/tests/auto/qtquick2/qquicklistview/tst_qquicklistview.cpp +++ b/tests/auto/qtquick2/qquicklistview/tst_qquicklistview.cpp @@ -1359,6 +1359,7 @@ void tst_QQuickListView::moved(const QUrl &source) QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); + QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false); QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); @@ -1496,6 +1497,26 @@ void tst_QQuickListView::moved_data() << 0 << 5 << 3 << 20.0 * 3; // moving 3 from above the content y should adjust y positions accordingly + QTest::newRow("move multiple forwards, mix of non-visible/visible") + << 40.0 + << 1 << 16 << 2 + << 20.0; // item 1,2 are removed, item 3 is now first visible + + QTest::newRow("move multiple forwards, to bottom of view") + << 0.0 + << 5 << 13 << 3 + << 0.0; + + QTest::newRow("move multiple forwards, to bottom of view, first->last") + << 0.0 + << 0 << 13 << 3 + << 0.0; + + QTest::newRow("move multiple forwards, to bottom of view, content y not 0") + << 80.0 + << 5+4 << 13+4 << 3 + << 0.0; + QTest::newRow("move multiple forwards, from visible -> non-visible") << 0.0 << 1 << 16 << 3 |