aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickevents.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2020-06-08 09:21:58 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2020-06-11 22:00:19 +0200
commit212c2bffbb041aee0e3c9a7f0551ef151ed2d3ad (patch)
treea9e5265252c2ccfead34d4e42fe8149358bff0f1 /src/quick/items/qquickevents.cpp
parent974c8da34d79cd8fc417ff5d69bc00c1e910e5ac (diff)
Replace calls to deprecated QEvent accessor functions
Several event accessors were deprecated in qtbase/24e52c10deedbaef833c0e2c3ee7bee03eacc4f5. Replacements were generated by clazy using the new qevent-accessors check: $ export CLAZY_CHECKS=qevent-accessors $ export CLAZY_EXPORT_FIXES=1 $ ../qt6/configure -platform linux-clang -developer-build -debug -no-optimize-debug -opensource -confirm-license -no-pch QMAKE_CXX=clazy $ make $ cd ../../qt6/qtdeclarative $ find . -name "*.clazy.yaml" $ clang-apply-replacements . Task-number: QTBUG-20885 Task-number: QTBUG-84775 Change-Id: I1be5819506fd5039e86b4494223acbe193e6b0c9 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/items/qquickevents.cpp')
-rw-r--r--src/quick/items/qquickevents.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/quick/items/qquickevents.cpp b/src/quick/items/qquickevents.cpp
index 783034fd18..80f572d3b5 100644
--- a/src/quick/items/qquickevents.cpp
+++ b/src/quick/items/qquickevents.cpp
@@ -1206,7 +1206,7 @@ QQuickEventTouchPoint::QQuickEventTouchPoint(QQuickPointerTouchEvent *parent)
void QQuickEventTouchPoint::reset(const QTouchEvent::TouchPoint &tp, ulong timestamp)
{
- QQuickEventPoint::reset(tp.state(), tp.scenePos(), tp.id(), timestamp, tp.velocity());
+ QQuickEventPoint::reset(tp.state(), tp.scenePosition(), tp.id(), timestamp, tp.velocity());
m_exclusiveGrabber.clear();
m_passiveGrabbers.clear();
m_rotation = tp.rotation();
@@ -1396,7 +1396,7 @@ QQuickPointerEvent *QQuickPointerMouseEvent::reset(QEvent *event)
default:
break;
}
- m_point->reset(state, ev->windowPos(), quint64(1) << 24, ev->timestamp()); // mouse has device ID 1
+ m_point->reset(state, ev->scenePosition(), quint64(1) << 24, ev->timestamp()); // mouse has device ID 1
return this;
}
@@ -1509,7 +1509,7 @@ QQuickPointerEvent *QQuickPointerNativeGestureEvent::reset(QEvent *event)
break;
}
quint64 deviceId = QTouchDevicePrivate::get(const_cast<QTouchDevice *>(ev->device()))->id; // a bit roundabout since QTouchDevice::mTouchDeviceId is protected
- m_point->reset(state, ev->windowPos(), deviceId << 24, ev->timestamp());
+ m_point->reset(state, ev->scenePosition(), deviceId << 24, ev->timestamp());
return this;
}
#endif // QT_CONFIG(gestures)
@@ -1919,8 +1919,8 @@ QMouseEvent *QQuickPointerTouchEvent::syntheticMouseEvent(int pointID, QQuickIte
Q_ASSERT(false);
return nullptr;
}
- m_synthMouseEvent = QMouseEvent(type, relativeTo->mapFromScene(p->scenePos()),
- p->scenePos(), p->screenPos(), Qt::LeftButton, buttons, m_event->modifiers());
+ m_synthMouseEvent = QMouseEvent(type, relativeTo->mapFromScene(p->scenePosition()),
+ p->scenePosition(), p->globalPosition(), Qt::LeftButton, buttons, m_event->modifiers());
m_synthMouseEvent.setAccepted(true);
m_synthMouseEvent.setTimestamp(m_event->timestamp());
// In the future we will try to always have valid velocity in every QQuickEventPoint.
@@ -1980,7 +1980,7 @@ void QQuickEventTabletPoint::reset(const QTabletEvent *ev)
default:
break;
}
- QQuickEventPoint::reset(state, ev->posF(), 1, ev->timestamp());
+ QQuickEventPoint::reset(state, ev->position(), 1, ev->timestamp());
m_rotation = ev->rotation();
m_pressure = ev->pressure();
m_tangentialPressure = ev->tangentialPressure();
@@ -2176,9 +2176,9 @@ QTouchEvent *QQuickPointerTouchEvent::touchEventForItem(QQuickItem *item, bool i
anyStationaryWithModifiedPropertyInside = true;
eventStates |= tp->state();
QTouchEvent::TouchPoint tpCopy = *tp;
- tpCopy.setPos(item->mapFromScene(tpCopy.scenePos()));
+ tpCopy.setPos(item->mapFromScene(tpCopy.scenePosition()));
tpCopy.setLastPos(item->mapFromScene(tpCopy.lastScenePos()));
- tpCopy.setStartPos(item->mapFromScene(tpCopy.startScenePos()));
+ tpCopy.setStartPos(item->mapFromScene(tpCopy.scenePressPosition()));
tpCopy.setEllipseDiameters(tpCopy.ellipseDiameters());
tpCopy.setVelocity(transformMatrix.mapVector(tpCopy.velocity()).toVector2D());
touchPoints << tpCopy;