diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2015-08-05 12:45:48 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-02-09 14:32:32 +0000 |
commit | 12f3f20be7e160b4f8de4ee267909fec61673111 (patch) | |
tree | 46bb48b514d537315a920dbe135c60f05d49d4f8 /tests/manual/pointer | |
parent | cb78d5c91ed33543a8e7fe7717f74f95834e4cc3 (diff) |
TapHandler: add timeHeld property
It enables long-press gestures to have continuous feedback.
Change-Id: Idd0838aff6213ebfc2fce66639bbc932e77208b4
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'tests/manual/pointer')
-rw-r--r-- | tests/manual/pointer/tapHandler.qml | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/manual/pointer/tapHandler.qml b/tests/manual/pointer/tapHandler.qml index 2e45b1c369..06070a02ff 100644 --- a/tests/manual/pointer/tapHandler.qml +++ b/tests/manual/pointer/tapHandler.qml @@ -81,7 +81,7 @@ Item { } onLongPressed: longPressFeedback.createObject(rect, {"x": pos.x, "y": pos.y, - "text": "long press", + "text": Math.round(handler.timeHeld).toFixed(3) + " sec", "color": borderBlink.blinkColor}) } @@ -112,6 +112,20 @@ Item { } } + Rectangle { + id: expandingCircle + radius: handler.timeHeld * 100 + visible: radius > 0 && handler.isPressed + border.width: 3 + border.color: borderBlink.blinkColor + color: "transparent" + width: radius * 2 + height: radius * 2 + x: handler.pressPos.x - radius + y: handler.pressPos.y - radius + opacity: 0.25 + } + Component { id: longPressFeedback Text { } |