From 5beb842b98cc7e18f82cf3237e96085f6808a9b3 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 7 Jan 2022 12:49:05 +0100 Subject: [PATCH] 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 Reviewed-by: Shawn Rutledge --- src/gui/kernel/qwindowsysteminterface.cpp | 12 ++++++------ 1 file 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 QList::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.