From 1204ed14dc11e6343a569646428a7ffddd098f8c Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Mon, 13 Jul 2020 23:55:13 +0200 Subject: Begin handling the QEvent refactoring This is an intermediate step to get Qt Quick working again after qtbase 4e400369c08db251cd489fec1229398c224d02b4. - QQuickEventPoint::id() is no longer unique across devices, because now eventPoint.event.device tells which specific device the event comes from. (In Qt 5, we could not yet add the device pointer to QInputEvent.) - However, MultiPointTouchArea's docs say that each pointId is unique, and so do the HandlerPoint docs (for similar use cases with PointHandler). So we still need the same hack using a Qt-specific short device ID to unique-ify the QEventPoint::id(). Now we use the device index in QInputDevice::devices() as the short ID. - Otherwise, we trust QInputDevice::systemId() and QEventPoint::id() more than before. - Use QMutable* classes from qevent_p.h to continue using setters that were in QTouchEvent before, etc. But setTouchPoints() is not there, so we have to make new event instances in a couple of cases. - QGuiApplicationPrivate::setMouseEventCapsAndVelocity() and setMouseEventSource() are gone. - Use (compiler-written) event copy constructors when possible. Task-number: QTBUG-72173 Change-Id: I3915dc535ae4c5a81cbf333aba9355f01c420c15 Reviewed-by: Fabian Kosmale --- .../qquickpinchhandler/tst_qquickpinchhandler.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'tests/auto/quick/pointerhandlers/qquickpinchhandler') diff --git a/tests/auto/quick/pointerhandlers/qquickpinchhandler/tst_qquickpinchhandler.cpp b/tests/auto/quick/pointerhandlers/qquickpinchhandler/tst_qquickpinchhandler.cpp index 89e9fa3f23..cd24d8643e 100644 --- a/tests/auto/quick/pointerhandlers/qquickpinchhandler/tst_qquickpinchhandler.cpp +++ b/tests/auto/quick/pointerhandlers/qquickpinchhandler/tst_qquickpinchhandler.cpp @@ -29,8 +29,9 @@ #include #include #include +#include #include -#include +#include #include #include #include @@ -186,12 +187,12 @@ void tst_QQuickPinchHandler::pinchProperties() QCOMPARE(rotMaxSpy.count(),1); } -QEventPoint makeTouchPoint(int id, QPoint p, QQuickView *v, QQuickItem *i) +QMutableEventPoint makeTouchPoint(int id, QPoint p, QQuickView *v, QQuickItem *i) { - QEventPoint touchPoint(id); - touchPoint.setPos(i->mapFromScene(p)); - touchPoint.setScreenPos(v->mapToGlobal(p)); - touchPoint.setScenePos(p); + QMutableEventPoint touchPoint(id); + touchPoint.setPosition(i->mapFromScene(p)); + touchPoint.setGlobalPosition(v->mapToGlobal(p)); + touchPoint.setScenePosition(p); return touchPoint; } -- cgit v1.2.3