summaryrefslogtreecommitdiffstats
path: root/src/widgets/graphicsview/qgraphicsscene.cpp
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2020-09-17 12:06:52 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-09-23 19:50:26 +0200
commit9c5698a8fcf9b890d8ed23b8e6cbab2971c8dc87 (patch)
treef32317cd546af26c1bc0439d99cf98c34ce99849 /src/widgets/graphicsview/qgraphicsscene.cpp
parent850d850c5af8ff77a4b9d53457ec6b1ba6c20cb3 (diff)
Fix compiler warnings from deprecated QTouchEvent::touchPoints
Replace with QPointerEvent::points(). As a drive-by, turn QEventPoint copies into const references where possible. Change-Id: Ia5e0645493984fe9177dd3ca16afdb4d56e384ee Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/widgets/graphicsview/qgraphicsscene.cpp')
-rw-r--r--src/widgets/graphicsview/qgraphicsscene.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp
index 8c93515d14..53e72ab542 100644
--- a/src/widgets/graphicsview/qgraphicsscene.cpp
+++ b/src/widgets/graphicsview/qgraphicsscene.cpp
@@ -5858,7 +5858,7 @@ void QGraphicsScenePrivate::touchEventHandler(QTouchEvent *sceneTouchEvent)
typedef QPair<QEventPoint::States, QList<QEventPoint> > StatesAndTouchPoints;
QHash<QGraphicsItem *, StatesAndTouchPoints> itemsNeedingEvents;
- const auto touchPoints = sceneTouchEvent->touchPoints();
+ const auto &touchPoints = sceneTouchEvent->points();
for (const auto &touchPoint : touchPoints) {
// update state
QGraphicsItem *item = nullptr;
@@ -5956,7 +5956,7 @@ void QGraphicsScenePrivate::touchEventHandler(QTouchEvent *sceneTouchEvent)
bool res = sendTouchBeginEvent(item, &touchEvent) && touchEvent.isAccepted();
if (!res) {
// forget about these touch points, we didn't handle them
- const auto unhandledTouchPoints = touchEvent.touchPoints();
+ const auto &unhandledTouchPoints = touchEvent.points();
for (const auto &touchPoint : unhandledTouchPoints) {
itemForTouchPointId.remove(touchPoint.id());
sceneCurrentTouchPoints.remove(touchPoint.id());
@@ -5983,7 +5983,7 @@ bool QGraphicsScenePrivate::sendTouchBeginEvent(QGraphicsItem *origin, QTouchEve
if (focusOnTouch) {
if (cachedItemsUnderMouse.isEmpty() || cachedItemsUnderMouse.constFirst() != origin) {
- const QEventPoint &firstTouchPoint = touchEvent->touchPoints().first();
+ const QEventPoint &firstTouchPoint = touchEvent->points().first();
cachedItemsUnderMouse = itemsAtPosition(firstTouchPoint.globalPosition().toPoint(),
firstTouchPoint.scenePosition(),
static_cast<QWidget *>(touchEvent->target()));
@@ -6026,7 +6026,7 @@ bool QGraphicsScenePrivate::sendTouchBeginEvent(QGraphicsItem *origin, QTouchEve
touchEvent->setAccepted(acceptTouchEvents);
res = acceptTouchEvents && sendEvent(item, touchEvent);
eventAccepted = touchEvent->isAccepted();
- if (itemForTouchPointId.value(touchEvent->touchPoints().first().id()) == 0) {
+ if (itemForTouchPointId.value(touchEvent->points().first().id()) == 0) {
// item was deleted
item = nullptr;
} else {
@@ -6035,7 +6035,7 @@ bool QGraphicsScenePrivate::sendTouchBeginEvent(QGraphicsItem *origin, QTouchEve
touchEvent->spont = false;
if (res && eventAccepted) {
// the first item to accept the TouchBegin gets an implicit grab.
- const auto touchPoints = touchEvent->touchPoints();
+ const auto &touchPoints = touchEvent->points();
for (const auto &touchPoint : touchPoints)
itemForTouchPointId[touchPoint.id()] = item; // can be zero
break;