aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2016-07-15 16:24:34 +0200
committerFrederik Gladhorn <frederik.gladhorn@qt.io>2016-07-21 11:13:12 +0000
commitc856d877e77048701182cc0e5ae275c398e55166 (patch)
treefe6b58b1872bc566982402bedaa8c6af9ad336f3 /tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
parentf727b9baad6a061fbd3625afe0295077dccff610 (diff)
Hierarchy for touch and mouse pointer events
Change-Id: Ie84e39918d9657b29df697be7b0e5198298c48ba Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/auto/quick/qquickwindow/tst_qquickwindow.cpp')
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp67
1 files changed, 33 insertions, 34 deletions
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index fd1024a8b3..18f1b28b02 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -2322,48 +2322,47 @@ void tst_qquickwindow::testHoverChildMouseEventFilter()
void tst_qquickwindow::pointerEventTypeAndPointCount()
{
- QQuickPointerEvent pe;
QMouseEvent me(QEvent::MouseButtonPress, QPointF(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
QTouchEvent te(QEvent::TouchBegin, touchDevice, Qt::NoModifier, Qt::TouchPointPressed,
QList<QTouchEvent::TouchPoint>() << QTouchEvent::TouchPoint(1));
- QVERIFY(!pe.isValid());
-
- pe.reset(&me);
- QVERIFY(pe.isValid());
- QVERIFY(pe.isMouseEvent());
- QVERIFY(!pe.isTouchEvent());
- QVERIFY(!pe.isTabletEvent());
- QVERIFY(pe.asMouseEvent());
- QVERIFY(!pe.asTouchEvent());
-// QVERIFY(!pe.asTabletEvent()); // TODO
- QCOMPARE(pe.pointCount(), 1);
-
- pe.reset(&te);
- QVERIFY(pe.isValid());
- QVERIFY(!pe.isMouseEvent());
- QVERIFY(pe.isTouchEvent());
- QVERIFY(!pe.isTabletEvent());
- QVERIFY(!pe.asMouseEvent());
- QVERIFY(pe.asTouchEvent());
-// QVERIFY(!pe.asTabletEvent()); // TODO
- QCOMPARE(pe.pointCount(), 1);
- QCOMPARE(pe.touchPointById(1)->id(), 1);
- QVERIFY(!pe.touchPointById(0));
+ QQuickPointerMouseEvent pme;
+ pme.reset(&me);
+ QVERIFY(pme.isValid());
+ QVERIFY(pme.isMouseEvent());
+ QVERIFY(!pme.isTouchEvent());
+ QVERIFY(!pme.isTabletEvent());
+ QVERIFY(pme.asMouseEvent());
+ QVERIFY(!pme.asTouchEvent());
+// QVERIFY(!pe->asTabletEvent()); // TODO
+ QCOMPARE(pme.pointCount(), 1);
+
+ QQuickPointerTouchEvent pte;
+ pte.reset(&te);
+ QVERIFY(pte.isValid());
+ QVERIFY(!pte.isMouseEvent());
+ QVERIFY(pte.isTouchEvent());
+ QVERIFY(!pte.isTabletEvent());
+ QVERIFY(!pte.asMouseEvent());
+ QVERIFY(pte.asTouchEvent());
+// QVERIFY(!pte.asTabletEvent()); // TODO
+ QCOMPARE(pte.pointCount(), 1);
+ QCOMPARE(pte.touchPointById(1)->id(), 1);
+ QVERIFY(!pte.touchPointById(0));
te.setTouchPoints(QList<QTouchEvent::TouchPoint>() << QTouchEvent::TouchPoint(1) << QTouchEvent::TouchPoint(2));
- pe.reset(&te);
- QCOMPARE(pe.pointCount(), 2);
- QCOMPARE(pe.touchPointById(1)->id(), 1);
- QCOMPARE(pe.touchPointById(2)->id(), 2);
- QVERIFY(!pe.touchPointById(0));
+ pte.reset(&te);
+ QCOMPARE(pte.pointCount(), 2);
+ QCOMPARE(pte.touchPointById(1)->id(), 1);
+ QCOMPARE(pte.touchPointById(2)->id(), 2);
+ QVERIFY(!pte.touchPointById(0));
te.setTouchPoints(QList<QTouchEvent::TouchPoint>() << QTouchEvent::TouchPoint(2));
- pe.reset(&te);
- QCOMPARE(pe.pointCount(), 1);
- QCOMPARE(pe.touchPointById(2)->id(), 2);
- QVERIFY(!pe.touchPointById(1));
- QVERIFY(!pe.touchPointById(0));
+ pte.reset(&te);
+ QCOMPARE(pte.pointCount(), 1);
+ QCOMPARE(pte.touchPointById(2)->id(), 2);
+ QVERIFY(!pte.touchPointById(1));
+ QVERIFY(!pte.touchPointById(0));
}
QTEST_MAIN(tst_qquickwindow)