aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickflickable
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@live.com>2013-10-03 21:14:08 -0500
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-04 15:40:52 +0200
commit717c65e199ed456e5d637d9802422fdefdedeb28 (patch)
tree1842ec33ee6f935ee9000a6ffa70180e59a73c10 /tests/auto/quick/qquickflickable
parent9b82136534bfb6877dae6318ab9c7f4259131b0f (diff)
Fix regression in pressDelay behavior.
Don't deliver a press event when a Flickable is moved before the pressDelay expires. This prevents delegates flickering between pressed and unpressed states when beginning to flick a Flickable. Fixes regression introduced by 429af6244518172e19abf7fecd7112f26bac6b31/ d02131e743597b9bd3070d986c61a1c91ea8317a. Task-number: QTBUG-31168 Change-Id: Id4e853fabe99000837df3681acd8fc4e76d2e9b3 Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
Diffstat (limited to 'tests/auto/quick/qquickflickable')
-rw-r--r--tests/auto/quick/qquickflickable/tst_qquickflickable.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
index 4392055dde..3c518c509b 100644
--- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
+++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
@@ -414,6 +414,23 @@ void tst_qquickflickable::pressDelay()
// On release the clicked signal should be emitted
QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(150, 150));
QCOMPARE(clickedSpy.count(),1);
+
+ // QTBUG-31168
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(150, 110));
+
+ // The press should not occur immediately
+ QVERIFY(mouseArea->property("pressed").toBool() == false);
+
+ QTest::mouseMove(window.data(), QPoint(150, 190));
+
+ // As we moved pass the drag threshold, we should never receive the press
+ QVERIFY(mouseArea->property("pressed").toBool() == false);
+ QTest::qWait(200);
+ QVERIFY(mouseArea->property("pressed").toBool() == false);
+
+ // On release the clicked signal should *not* be emitted
+ QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(150, 190));
+ QCOMPARE(clickedSpy.count(),1);
}
// QTBUG-17361