diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-01-07 12:49:05 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-01-13 02:27:36 +0100 |
commit | 5beb842b98cc7e18f82cf3237e96085f6808a9b3 (patch) | |
tree | 4ec8b2c5e53a96006eac17942152a349a0e89084 /src/gui/kernel/qwindowsysteminterface.cpp | |
parent | 214df31916c53e46348173fc02fe53f2b9db729a (diff) |
QWindowSystemInterface: port to QMutableEventPoint static setter API
This code was actually ok (no UB), but it's in the way of making
QMutableEventPoint a befriendable namespace, so port from using
QMutableEventPoint to QEventPoint instances + QMutableEventPoint
static setters.
Task-number: QTBUG-99615
Pick-to: 6.3
Change-Id: I1f123837d62a2200e36faf89f6912ee59be2f915
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/gui/kernel/qwindowsysteminterface.cpp')
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index 001c5206d0..d4e7c5553a 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -681,14 +681,14 @@ QList<QEventPoint> QList<QWindowSystemInterface::TouchPoint>::const_iterator end = points.constEnd(); while (point != end) { QPointF globalPos = QHighDpi::fromNativePixels(point->area.center(), window); - QMutableEventPoint p(point->id, point->state, globalPos, globalPos); + QEventPoint p(point->id, point->state, globalPos, globalPos); states |= point->state; if (point->uniqueId >= 0) - p.setUniqueId(QPointingDeviceUniqueId::fromNumericId(point->uniqueId)); - p.setPressure(point->pressure); - p.setRotation(point->rotation); - p.setEllipseDiameters(QHighDpi::fromNativePixels(point->area.size(), window)); - p.setVelocity(QHighDpi::fromNativePixels(point->velocity, window)); + QMutableEventPoint::setUniqueId(p, QPointingDeviceUniqueId::fromNumericId(point->uniqueId)); + QMutableEventPoint::setPressure(p, point->pressure); + QMutableEventPoint::setRotation(p, point->rotation); + QMutableEventPoint::setEllipseDiameters(p, QHighDpi::fromNativePixels(point->area.size(), window)); + QMutableEventPoint::setVelocity(p, QHighDpi::fromNativePixels(point->velocity, window)); // The local pos is not set: it will be calculated // when the event gets processed by QGuiApplication. |