aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickflickable
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2015-04-14 14:55:24 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2016-08-05 08:59:52 +0000
commitebf07c3f68415099132856b2831633c310bc3395 (patch)
tree685ea0baeb507071f1095f3015bf9cc113675f61 /tests/auto/quick/qquickflickable
parentb65b6bd5a6d571ad7047d85508f85c62ca9ad8ce (diff)
Flickable: avoid infinite velocity during release after drag
It sometimes happens on touchscreens that mouse events occur too close together. We cannot calculate velocity based on zero elapsed time, so just ignore the event. Task-number: QTBUG-45527 Change-Id: I120e73cfa60e2fcc594cb1f3b69f530e746abddd Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Diffstat (limited to 'tests/auto/quick/qquickflickable')
-rw-r--r--tests/auto/quick/qquickflickable/tst_qquickflickable.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
index 2e134ff5ad..294f7069c0 100644
--- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
+++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
@@ -1466,6 +1466,7 @@ void tst_qquickflickable::flickWithTouch(QQuickWindow *window, QTouchDevice *tou
for (int i = 1; i <= 8; ++i) {
QTest::touchEvent(window, touchDevice).move(0, from + i*diff/8, window);
QQuickTouchUtils::flush(window);
+ QTest::qWait(1); // because Flickable pays attention to velocity, we need some time between movements
}
QTest::touchEvent(window, touchDevice).release(0, to, window);
QQuickTouchUtils::flush(window);