aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-09-20 11:38:16 +0200
committerLiang Qi <liang.qi@qt.io>2017-09-20 14:27:41 +0200
commit55a671ea73fbe657f360befa221e2c0c15ed4b0e (patch)
tree475e5734183e93311c40971a40bb9ea60b816978 /tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
parent2aba6e35dc6f1534a764690382ca56b6cf099185 (diff)
parent61716e2bbcc62d7447b4d9e8531ad98737407d12 (diff)
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts: src/qml/compiler/qv4compileddata.cpp src/qml/compiler/qv4compileddata_p.h src/qml/jsruntime/qv4engine.cpp src/qml/jsruntime/qv4qmlcontext.cpp src/qml/jsruntime/qv4qmlcontext_p.h src/qml/jsruntime/qv4regexpobject.cpp src/qml/jsruntime/qv4regexpobject_p.h src/qml/types/qqmllistmodel.cpp src/quick/items/qquickanimatedimage_p.h src/quick/scenegraph/qsgrenderloop.cpp tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp Change-Id: If20ef62b2c98bdf656cb2f5d27b1897b754d3dc0
Diffstat (limited to 'tests/auto/quick/qquicklistview/tst_qquicklistview.cpp')
-rw-r--r--tests/auto/quick/qquicklistview/tst_qquicklistview.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
index 2eb87b9431..0d0f234d33 100644
--- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
+++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
@@ -236,6 +236,7 @@ private slots:
void QTBUG_38209();
void programmaticFlickAtBounds();
void programmaticFlickAtBounds2();
+ void programmaticFlickAtBounds3();
void layoutChange();
@@ -8069,6 +8070,35 @@ void tst_QQuickListView::programmaticFlickAtBounds2()
QTRY_COMPARE(listview->contentY(), qreal(100.0));
}
+void tst_QQuickListView::programmaticFlickAtBounds3()
+{
+ QScopedPointer<QQuickView> window(createView());
+ window->setSource(testFileUrl("programmaticFlickAtBounds3.qml"));
+ window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
+
+ QQuickListView *listview = qobject_cast<QQuickListView *>(window->rootObject());
+ QVERIFY(listview);
+
+ // flick down
+ listview->flick(0, 2000);
+
+ // verify scope of the movement
+ QTRY_VERIFY(listview->property("minOvershoot").toReal() < qreal(-50.0));
+
+ // reset, and test a second time
+ listview->cancelFlick();
+ listview->returnToBounds();
+ QTRY_COMPARE(listview->contentY(), qreal(0.0));
+ listview->setProperty("minOvershoot", qreal(0.0));
+
+ // flick down
+ listview->flick(0, 2000);
+
+ // verify scope of the movement is the same
+ QTRY_VERIFY(listview->property("minOvershoot").toReal() < qreal(-50.0));
+}
+
void tst_QQuickListView::layoutChange()
{
RandomSortModel *model = new RandomSortModel;