diff options
author | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2012-03-19 12:35:45 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-21 08:04:33 +0100 |
commit | 1312f4d1fefb3a7b5b8c7b720c45f542981250f3 (patch) | |
tree | 587ddb1363fcab7f954fe3af2c25b8ac2415a7e7 /tests/auto/quick/qquickflickable/tst_qquickflickable.cpp | |
parent | 80b5612708a115613c534644053eb0d8b2cda108 (diff) |
Allow flick on press-move-release in Flickable.
Right now it needs at least a press-move-move-release to start a flick
which is not ideal for touchscreens because a quick, short flick may
result in reporting only a single move.
Change-Id: I9bf2b4fea23b0eea9d9d00f0e79ce34f4d964bea
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto/quick/qquickflickable/tst_qquickflickable.cpp')
-rw-r--r-- | tests/auto/quick/qquickflickable/tst_qquickflickable.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp index 9f5bd46864..2ed42e7f0f 100644 --- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp +++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp @@ -441,6 +441,19 @@ void tst_qquickflickable::movingAndDragging() // wait for any motion to end QTRY_VERIFY(flickable->isMoving() == false); + // Vertical with a quick press-move-release: should cause a flick in release. + QSignalSpy vFlickSpy(flickable, SIGNAL(flickingVerticallyChanged())); + + QTest::mousePress(canvas, Qt::LeftButton, 0, QPoint(50, 90)); + QTest::qWait(10); + QTest::mouseMove(canvas, QPoint(50, 40)); + QTest::mouseRelease(canvas, Qt::LeftButton, 0, QPoint(50, 40)); + + QCOMPARE(vFlickSpy.count(), 1); + + // wait for any motion to end + QTRY_VERIFY(flickable->isMoving() == false); + //Horizontal vDragSpy.clear(); hDragSpy.clear(); @@ -493,7 +506,7 @@ void tst_qquickflickable::movingAndDragging() vMoveSpy.clear(); hMoveSpy.clear(); moveSpy.clear(); - QSignalSpy vFlickSpy(flickable, SIGNAL(flickingVerticallyChanged())); + vFlickSpy.clear(); QSignalSpy hFlickSpy(flickable, SIGNAL(flickingHorizontallyChanged())); QSignalSpy flickSpy(flickable, SIGNAL(flickingChanged())); |