summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2010-04-06 05:56:38 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2010-04-06 05:56:38 (GMT)
commit51381e1454070960bc3c1d6acdfa8e742c37620c (patch)
treedb36c886a10edde3c55c4dc4d82fbf05f8beb927 /examples
parent37e8fd4e09c1221efde3e67e6acd5cfbb35686fd (diff)
downloadQt-51381e1454070960bc3c1d6acdfa8e742c37620c.zip
Qt-51381e1454070960bc3c1d6acdfa8e742c37620c.tar.gz
Qt-51381e1454070960bc3c1d6acdfa8e742c37620c.tar.bz2
Labs (experimental) Gesture support.
By popular demand.
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/gestures/experimental-gestures.qml27
1 files changed, 27 insertions, 0 deletions
diff --git a/examples/declarative/gestures/experimental-gestures.qml b/examples/declarative/gestures/experimental-gestures.qml
new file mode 100644
index 0000000..914d403
--- /dev/null
+++ b/examples/declarative/gestures/experimental-gestures.qml
@@ -0,0 +1,27 @@
+import Qt 4.7
+import Qt.labs.gestures 1.0
+
+// Only works on platforms with Touch support.
+
+Rectangle {
+ id: rect
+
+ GestureArea {
+ anchors.fill: parent
+
+ // Only some of the many gesture properties are shown. See Gesture documentation.
+
+ onTap:
+ console.log("tap pos = (",gesture.position.x,",",gesture.position.y,")")
+ onTapAndHold:
+ console.log("tap and hold pos = (",gesture.position.x,",",gesture.position.y,")")
+ onPan:
+ console.log("pan delta = (",gesture.delta.x,",",gesture.delta.y,") acceleration = ",gesture.acceleration)
+ onPinch:
+ console.log("pinch center = (",gesture.centerPoint.x,",",gesture.centerPoint.y,") rotation =",gesture.rotationAngle," scale =",gesture.scaleFactor)
+ onSwipe:
+ console.log("swipe angle=",gesture.swipeAngle)
+ onGesture:
+ console.log("gesture hot spot = (",gesture.hotSpot.x,",",gesture.hotSpot.y,")")
+ }
+}