diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-12-07 23:02:03 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-12-11 00:51:10 +0100 |
commit | 9da1f6b6080b667f7e879f953441b713ccff656b (patch) | |
tree | ac3bde4f50f599cec222126418e8423deb6f8f74 /src/widgets/kernel/qapplication_p.h | |
parent | 4229de1685dd0a671f332faf7bfed3ffe5cd8a87 (diff) |
Fix widget gesture grabbing
After 7369c31ca1f446e81eda1c93ba13767ffcd83efe, unaccepted touch points
were not grabbed anymore in calls to activateImplicitTouchGrab. However,
gesture recognition relies that widgets for which a gesture has been
partially recognized grab also unaccepted touch points.
Add a parameter to allow the implicit grabbing to take place also for
unaccepted event points.
Add test case that replays touch events similar to what Squish is doing,
and fails without this fix.
Pick-to: 6.2
Change-Id: Idb0b20301b1827be57a03013a59043d97c2ee7b6
Reviewed-by: Stefan Gehn <stefan.gehn@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/widgets/kernel/qapplication_p.h')
-rw-r--r-- | src/widgets/kernel/qapplication_p.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index 6bb1f35d1b..155081fd79 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -248,7 +248,9 @@ public: QWidget *findClosestTouchPointTarget(const QPointingDevice *device, const QEventPoint &touchPoint); void appendTouchPoint(const QEventPoint &touchPoint); void removeTouchPoint(int touchPointId); - void activateImplicitTouchGrab(QWidget *widget, QTouchEvent *touchBeginEvent); + enum ImplicitTouchGrabMode { GrabAcceptedPoints, GrabAllPoints }; + void activateImplicitTouchGrab(QWidget *widget, QTouchEvent *touchBeginEvent, + ImplicitTouchGrabMode grabMode = GrabAcceptedPoints); static bool translateRawTouchEvent(QWidget *widget, const QTouchEvent *touchEvent); static void translateTouchCancel(const QPointingDevice *device, ulong timestamp); |