aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2017-11-20 14:01:12 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2017-12-16 16:34:39 +0000
commit96ec0ab8f0b2e53eff6e1887aff7e51601821845 (patch)
tree0e9b61605fba64388f71eda15734672c2a7af948 /tests
parent2cacc1c07a1e361bb20411d3f19fdecb3009be12 (diff)
QQuickList/GridViewPrivate::fixupPosition: don't set moveReason
In QQuickItemViewPrivate::applyModelChanges(), if moveReason = QQuickItemViewPrivate::Other, then QQuickItemView::trackedPositionChanged() will fail to call d->setPosition(pos), which is normally what keeps the Flickable moving for a while. Leave the reason as-is (it will be SetIndex in this case), so as not to forget that we were actually trying to move down when the sequence window->polishItems() -> QQIV::updatePolish() -> layout() -> fixupPosition() did its part of the work of moving down. Task-number: QTBUG-62864 Change-Id: I1021e2ea39265de9e1285e2ee17c5733189ab939 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/qquicklistview/tst_qquicklistview.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
index 223f6004ff..73d831ecdd 100644
--- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
+++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
@@ -255,6 +255,7 @@ private slots:
void QTBUG_50105();
void keyNavigationEnabled();
void QTBUG_61269_appendDuringScrollDown();
+ void QTBUG_61269_appendDuringScrollDown_data();
void QTBUG_50097_stickyHeader_positionViewAtIndex();
void QTBUG_63974_stickyHeader_positionViewAtIndex_Contain();
void itemFiltered();
@@ -8468,8 +8469,19 @@ void tst_QQuickListView::keyNavigationEnabled()
QCOMPARE(listView->currentIndex(), 1);
}
-void tst_QQuickListView::QTBUG_61269_appendDuringScrollDown()
+void tst_QQuickListView::QTBUG_61269_appendDuringScrollDown_data()
{
+ QTest::addColumn<QQuickListView::SnapMode>("snapMode");
+
+ QTest::newRow("NoSnap") << QQuickListView::NoSnap;
+ QTest::newRow("SnapToItem") << QQuickListView::SnapToItem;
+ QTest::newRow("SnapOneItem") << QQuickListView::SnapOneItem;
+}
+
+void tst_QQuickListView::QTBUG_61269_appendDuringScrollDown() // AKA QTBUG-62864
+{
+ QFETCH(QQuickListView::SnapMode, snapMode);
+
QScopedPointer<QQuickView> window(createView());
window->setSource(testFileUrl("appendDuringScrollDown.qml"));
window->show();
@@ -8477,6 +8489,7 @@ void tst_QQuickListView::QTBUG_61269_appendDuringScrollDown()
QVERIFY(QTest::qWaitForWindowActive(window.data()));
QQuickListView *listView = qobject_cast<QQuickListView *>(window->rootObject());
+ listView->setSnapMode(snapMode);
QQuickItem *highlightItem = listView->highlightItem();
QVERIFY(listView);
QCOMPARE(listView->isKeyNavigationEnabled(), true);