diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-03-26 16:50:40 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-06-23 17:44:03 +0200 |
commit | d0ae3a312a03c118a1aa25a4c6c0352375d569fc (patch) | |
tree | 01df3e8ea22c8a1ecd969a6e9e6d7014c635da9f /src/quick/items/qquickflickable.cpp | |
parent | d5d6a56809032796444fe63c220a2e940ce237c0 (diff) |
Remove QQuickPointerDevice in favor of QPointingDevice
...and generally deal with changes immediately required after adding
QInputDevice and QPointingDevice.
Also fixed a few usages of deprecated accessors that weren't taken
care of in 212c2bffbb041aee0e3c9a7f0551ef151ed2d3ad.
Task-number: QTBUG-46412
Task-number: QTBUG-69433
Task-number: QTBUG-72167
Change-Id: I93a2643162878afa216556f10808fd92e0b20071
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/items/qquickflickable.cpp')
-rw-r--r-- | src/quick/items/qquickflickable.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp index 0d9183315d..bd7242e99f 100644 --- a/src/quick/items/qquickflickable.cpp +++ b/src/quick/items/qquickflickable.cpp @@ -1322,7 +1322,8 @@ void QQuickFlickablePrivate::handleMouseMoveEvent(QMouseEvent *event) bool overThreshold = false; QVector2D velocity = QGuiApplicationPrivate::mouseEventVelocity(event); // TODO guarantee that events always have velocity so that it never needs to be computed here - if (!(QGuiApplicationPrivate::mouseEventCaps(event) & QTouchDevice::Velocity)) { + // TODO use event->device->caps() + if (!(QGuiApplicationPrivate::mouseEventCaps(event) & int(QInputDevice::Capability::Velocity))) { qint64 lastTimestamp = (lastPos.isNull() ? lastPressTime : lastPosTime); if (currentTimestamp == lastTimestamp) return; // events are too close together: velocity would be infinite @@ -1362,7 +1363,7 @@ void QQuickFlickablePrivate::handleMouseReleaseEvent(QMouseEvent *event) qreal vVelocity = 0; if (elapsed < 100 && vData.velocity != 0.) { - vVelocity = (QGuiApplicationPrivate::mouseEventCaps(event) & QTouchDevice::Velocity) + vVelocity = (QGuiApplicationPrivate::mouseEventCaps(event) & int(QInputDevice::Capability::Velocity)) ? QGuiApplicationPrivate::mouseEventVelocity(event).y() : vData.velocity; } if ((vData.atBeginning && vVelocity > 0.) || (vData.atEnd && vVelocity < 0.)) { @@ -1377,7 +1378,7 @@ void QQuickFlickablePrivate::handleMouseReleaseEvent(QMouseEvent *event) qreal hVelocity = 0; if (elapsed < 100 && hData.velocity != 0.) { - hVelocity = (QGuiApplicationPrivate::mouseEventCaps(event) & QTouchDevice::Velocity) + hVelocity = (QGuiApplicationPrivate::mouseEventCaps(event) & int(QInputDevice::Capability::Velocity)) ? QGuiApplicationPrivate::mouseEventVelocity(event).x() : hData.velocity; } if ((hData.atBeginning && hVelocity > 0.) || (hData.atEnd && hVelocity < 0.)) { |