diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-01-06 13:53:17 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-01-08 09:00:10 +0000 |
commit | ae49252dbcc21de1dccee03c54a8e0986c5a0acc (patch) | |
tree | b2e506cc41d991bf3ceeacee8ea254f560cf44b1 /src/widgets/graphicsview/qgraphicsview.cpp | |
parent | 12c56aa43a7c48f7f34e75c3a7fb1603102f1af5 (diff) |
QMutableEventPoint: add static overloads of setters
These overloads don't require a cast from QEventPoint to
QMutableEventPoint, thus avoiding undefined behavior.
Port easy users of QMutableEventPosition::(const)from()
to the new API.
Pick-to: 6.3
Task-number: QTBUG-99615
Change-Id: I4e9228322134ef7c712ca478ee8286466efc3585
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets/graphicsview/qgraphicsview.cpp')
-rw-r--r-- | src/widgets/graphicsview/qgraphicsview.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp index f4b9228e51..1a147e5e40 100644 --- a/src/widgets/graphicsview/qgraphicsview.cpp +++ b/src/widgets/graphicsview/qgraphicsview.cpp @@ -314,7 +314,7 @@ void QGraphicsViewPrivate::translateTouchEvent(QGraphicsViewPrivate *d, QTouchEv auto &pt = touchEvent->point(i); // the scene will set the item local pos, startPos, lastPos, and rect before delivering to // an item, but for now those functions are returning the view's local coordinates - QMutableEventPoint::from(pt).setScenePosition(d->mapToScene(pt.position())); + QMutableEventPoint::setScenePosition(pt, d->mapToScene(pt.position())); // screenPos, startScreenPos, and lastScreenPos are already set } } |