diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-05-20 17:08:44 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-05-27 09:41:51 +0200 |
commit | a10eeee97d42f05409074f69cc99d9a8da5db077 (patch) | |
tree | c8235581058a206e5cace882782b9027b702c5e2 /tests/manual/pointer/pinchHandler.qml | |
parent | 269357821a0fd67d7d762199c1174132c2f5cb11 (diff) |
Emit grabChanged() from DragHandler and PinchHandler
Followup to ca7cdd71ee33f0d77eb6bf1367d2532e26155cb2 : when overriding
a virtual function, it's good practice to call the base class function,
in the absence of any reason not to.
Pick-to: 5.15 6.1
Fixes: QTBUG-93880
Change-Id: Icbd04faec51d55d8fbf73319bd20f5846761d3d5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/manual/pointer/pinchHandler.qml')
-rw-r--r-- | tests/manual/pointer/pinchHandler.qml | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/manual/pointer/pinchHandler.qml b/tests/manual/pointer/pinchHandler.qml index 46ab91c2ed..93169da60a 100644 --- a/tests/manual/pointer/pinchHandler.qml +++ b/tests/manual/pointer/pinchHandler.qml @@ -154,6 +154,14 @@ Rectangle { if (!active) anim.restart(centroid.velocity) } + onGrabChanged: function (transition, point) { + if (transition === 0x10) { // GrabExclusive + console.log(point.id, "grabbed @", point.position) + Qt.createQmlObject("import QtQuick 2.0; Rectangle { opacity: 0.5; border.color: 'red'; radius: 8; width: radius * 2; height: radius * 2; " + + "x: " + (point.position.x - 8) + "; y: " + (point.position.y - 8) + "}", + rect3, "touchpoint" + point.id); + } + } } TapHandler { gesturePolicy: TapHandler.DragThreshold; onTapped: rect3.z = rect2.z + 1 } MomentumAnimation { id: anim; target: rect3 } |