diff options
author | Jan Arve Sæther <jan-arve.saether@qt.io> | 2020-09-03 10:51:01 +0200 |
---|---|---|
committer | Jan Arve Sæther <jan-arve.saether@qt.io> | 2020-09-04 19:42:01 +0200 |
commit | 8d3a91016506fd0afedb0be535f7c34a4ca762f6 (patch) | |
tree | cf8a799cf13e03d53850ca81ea3f27f122f914f7 /src/quick/handlers/qquickhandlerpoint.cpp | |
parent | a1c91787264f6f535b5cf094b57ee53058856df4 (diff) |
Fix TapHandler so that it actually registers a tap
This bug caused all quick examples that used the
shared\LauncherList.qml to be broken.
In QtGui, QSinglePointEvent will construct itself with a point id of 0
if there is a valid point, and with a point id of -1 if the point is
invalid (the default constructor does the latter).
However, QQuickSinglePointHandler::wantsPointerEvent() did not agree
with that, because it assumed that a point id of 0 meant
uninitialized/invalid point.
The fix is to change QQuickSinglePointHandler::wantsPointerEvent() and
QQuickHandlerPoint so that it assumes that the id -1 is now an invalid
point, (instead of 0)
Change-Id: I8c9683dfe06ebb77c5342a26f08174b67e7cbd90
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/handlers/qquickhandlerpoint.cpp')
-rw-r--r-- | src/quick/handlers/qquickhandlerpoint.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quick/handlers/qquickhandlerpoint.cpp b/src/quick/handlers/qquickhandlerpoint.cpp index 2e4602affa..2990215719 100644 --- a/src/quick/handlers/qquickhandlerpoint.cpp +++ b/src/quick/handlers/qquickhandlerpoint.cpp @@ -82,7 +82,7 @@ void QQuickHandlerPoint::localize(QQuickItem *item) void QQuickHandlerPoint::reset() { - m_id = 0; + m_id = -1; m_device = QPointingDevice::primaryPointingDevice(); m_uniqueId = QPointingDeviceUniqueId(); m_position = QPointF(); @@ -167,7 +167,7 @@ void QQuickHandlerPoint::reset(const QVector<QQuickHandlerPoint> &points) pressureSum += point.pressure(); ellipseDiameterSum += point.ellipseDiameters(); } - m_id = 0; + m_id = -1; m_device = nullptr; m_uniqueId = QPointingDeviceUniqueId(); // all points are required to be from the same event, so pressed buttons and modifiers should be the same |