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>
This commit is contained in:
Marc Mutz 2022-01-07 12:49:05 +01:00
parent 214df31916
commit 5beb842b98

View File

@ -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.