aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/shared
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2012-04-03 12:24:52 +0300
committerQt by Nokia <qt-info@nokia.com>2012-04-05 09:50:05 +0200
commitaa959012a82900ea90a13129af4a5c43b155b4e2 (patch)
tree4f6d86d870b98477d2493adabe9e915b2175b7b4 /tests/auto/quick/shared
parent664a0e3f498db65f74b0e0181a0ec76cd6691a34 (diff)
Properly copy all event parameters in deliverMouseEvent()
Timestamp and capabilities were missing. One of the very special flick test cases needs to be fixed, because setting the proper timestamp will now generate correct velocities. A potentially dangerous, legacy implementation of flick() has also been updated to match how QTestLib works in Qt 5. Change-Id: Ibc99f7212ba21d41a419eaadac2fdda730658dc6 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto/quick/shared')
-rw-r--r--tests/auto/quick/shared/viewtestutil.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/auto/quick/shared/viewtestutil.cpp b/tests/auto/quick/shared/viewtestutil.cpp
index d00a0e2a96..1c4319f82f 100644
--- a/tests/auto/quick/shared/viewtestutil.cpp
+++ b/tests/auto/quick/shared/viewtestutil.cpp
@@ -88,12 +88,8 @@ void QQuickViewTestUtil::flick(QQuickView *canvas, const QPoint &from, const QPo
// send press, five equally spaced moves, and release.
QTest::mousePress(canvas, Qt::LeftButton, 0, from);
- for (int i = 0; i < pointCount; ++i) {
- QMouseEvent mv(QEvent::MouseMove, from + (i+1)*diff/pointCount, Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
- QGuiApplication::sendEvent(canvas, &mv);
- QTest::qWait(duration/pointCount);
- QCoreApplication::processEvents();
- }
+ for (int i = 0; i < pointCount; ++i)
+ QTest::mouseMove(canvas, from + (i+1)*diff/pointCount, duration / pointCount);
QTest::mouseRelease(canvas, Qt::LeftButton, 0, to);
QTest::qWait(50);