QApplication: port manual users of QMutableEventPoint
... to new static setter API, which doesn't depend on undefined behavior. These users didn't use QMutableEventPoint::from(), but static_cast<>, so they were only found when the non-static setters were removed, locally. Task-number: QTBUG-99615 Pick-to: 6.3 Change-Id: I37faf17b2b180e0f6e8bb4e5f46951a2cc29678d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This commit is contained in:
parent
ae7e11e5c6
commit
54945d58b3
@ -3845,7 +3845,7 @@ QWidget *QApplicationPrivate::findClosestTouchPointTarget(const QPointingDevice
|
|||||||
if (closestTouchPointId == -1 || distance < closestDistance) {
|
if (closestTouchPointId == -1 || distance < closestDistance) {
|
||||||
closestTouchPointId = pt.id();
|
closestTouchPointId = pt.id();
|
||||||
closestDistance = distance;
|
closestDistance = distance;
|
||||||
closestTarget = static_cast<const QMutableEventPoint &>(pt).target();
|
closestTarget = QMutableEventPoint::target(pt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4016,7 +4016,7 @@ void QApplicationPrivate::translateTouchCancel(const QPointingDevice *device, ul
|
|||||||
const QPointingDevicePrivate *devPriv = QPointingDevicePrivate::get(device);
|
const QPointingDevicePrivate *devPriv = QPointingDevicePrivate::get(device);
|
||||||
for (auto &epd : devPriv->activePoints.values()) {
|
for (auto &epd : devPriv->activePoints.values()) {
|
||||||
const auto &pt = epd.eventPoint;
|
const auto &pt = epd.eventPoint;
|
||||||
QObject *target = static_cast<const QMutableEventPoint &>(pt).target();
|
QObject *target = QMutableEventPoint::target(pt);
|
||||||
if (target && target->isWidgetType())
|
if (target && target->isWidgetType())
|
||||||
widgetsNeedingCancel.insert(static_cast<QWidget *>(target));
|
widgetsNeedingCancel.insert(static_cast<QWidget *>(target));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user