Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.8.2
-
None
-
RAFI Glasscape Touch panel
Description
In the following standalone application, if a pinch gesture is performed, starting with one finger on the red Rectangle (which has an associated TapHandler) and the other finger outside of the red rectangle, after you see that scaling actually is happening, when the pinch gesture is then released, the TapHandler sometimes triggers and toggles the rectangle's color.
import QtQuick import QtQuick.Window Window { width: 500; height: 500; visible: true Rectangle { anchors.fill: parent color: "#dddddd" PinchHandler { property real initScale: 0.0 // to save baseline scale factor of the tappableRect when pinch starts target: null // because we want to handle activeScale changes ourselves grabPermissions: PointerHandler.CanTakeOverFromAnything // when pinch is happening, tap should NOT happen onActiveChanged: { if (active) { initScale = tappableRect.scale; } } onActiveScaleChanged: { if (active) { tappableRect.scale = initScale * activeScale; } } } Rectangle { id: tappableRect property bool toggled: false width: 100; height: 100; x: 100; y: 100 color: toggled ? "green" : "red" TapHandler { // in the hopes that pinching abandons a potential tap grabPermissions: PointerHandler.ApprovesTakeOverByAnything | PointerHandler.ApprovesCancellation onTapped: { tappableRect.toggled = !tappableRect.toggled; } } } } }
I can consistently reproduce it, see the attached picture
1) touch red rectangle with left finger first
2) add right finger to grey area
3) move fingers apart until you see scaling happening
4) release right finger from grey area
5) release left finger from red rectangle
Don't perform this sequence too slow, it only reproduces if it's done fast enough!
This will then always toggle the color of the rectangle, proving that the TapHandler also fired even though the PinchHandler has performed its thing.