summaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2015-08-05 12:45:48 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2017-02-09 14:32:32 +0000
commit12f3f20be7e160b4f8de4ee267909fec61673111 (patch)
tree46bb48b514d537315a920dbe135c60f05d49d4f8 /tests/manual
parentcb78d5c91ed33543a8e7fe7717f74f95834e4cc3 (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')
-rw-r--r--tests/manual/pointer/tapHandler.qml16
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 { }