From 9c5698a8fcf9b890d8ed23b8e6cbab2971c8dc87 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 17 Sep 2020 12:06:52 +0200 Subject: 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 --- src/widgets/graphicsview/qgraphicsscene.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/widgets/graphicsview/qgraphicsscene.cpp') 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 > StatesAndTouchPoints; QHash 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(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; -- cgit v1.2.3