aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2016-07-21 11:35:42 +0200
committerFrederik Gladhorn <frederik.gladhorn@qt.io>2016-07-21 14:14:56 +0000
commita5e7897dd7705a9df3a97e5de75b5b95d6a88e25 (patch)
tree39cbb88f5c25194b87f8124ae88e0c57e526d5b8 /tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
parentc856d877e77048701182cc0e5ae275c398e55166 (diff)
Improve encapsuation of touch/mouse event specific things
This makes it easy to avoid casts when using the classes. Change-Id: I27bd1244bffb3a7d2cdb4572c229333e4c499d9b 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.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index 18f1b28b02..1e1197637b 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -2329,21 +2329,20 @@ void tst_qquickwindow::pointerEventTypeAndPointCount()
QQuickPointerMouseEvent pme;
pme.reset(&me);
QVERIFY(pme.isValid());
- QVERIFY(pme.isMouseEvent());
- QVERIFY(!pme.isTouchEvent());
- QVERIFY(!pme.isTabletEvent());
- QVERIFY(pme.asMouseEvent());
- QVERIFY(!pme.asTouchEvent());
+ QCOMPARE(pme.asMouseEvent(), &me);
+ QVERIFY(pme.asPointerMouseEvent());
+ QVERIFY(!pme.asPointerTouchEvent());
+ QVERIFY(!pme.asPointerTabletEvent());
// 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());
+ QCOMPARE(pte.asTouchEvent(), &te);
+ QVERIFY(!pte.asPointerMouseEvent());
+ QVERIFY(pte.asPointerTouchEvent());
+ QVERIFY(!pte.asPointerTabletEvent());
QVERIFY(pte.asTouchEvent());
// QVERIFY(!pte.asTabletEvent()); // TODO
QCOMPARE(pte.pointCount(), 1);