aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/pointerhandlers/qquickpinchhandler
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2020-07-13 23:55:13 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2020-07-15 20:53:10 +0200
commit1204ed14dc11e6343a569646428a7ffddd098f8c (patch)
tree49ff80392d6ffbb18e6f5b3dbbe5aa366d230ac5 /tests/auto/quick/pointerhandlers/qquickpinchhandler
parent2967572e129cab889d9c6f89825ef9d77bf1ce63 (diff)
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 <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/quick/pointerhandlers/qquickpinchhandler')
-rw-r--r--tests/auto/quick/pointerhandlers/qquickpinchhandler/tst_qquickpinchhandler.cpp13
1 files changed, 7 insertions, 6 deletions
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 <QtTest/QtTest>
#include <QtTest/QSignalSpy>
#include <QtGui/QStyleHints>
+#include <QtGui/private/qevent_p.h>
#include <qpa/qwindowsysteminterface.h>
-#include <private/qquickpinchhandler_p.h>
+#include <QtQuick/private/qquickpinchhandler_p.h>
#include <QtQuick/private/qquickrectangle_p.h>
#include <QtQuick/qquickview.h>
#include <QtQml/qqmlcontext.h>
@@ -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;
}