summaryrefslogtreecommitdiffstats
path: root/examples/declarative/touchinteraction/gestures
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-05-14 01:32:57 (GMT)
committerBea Lam <bea.lam@nokia.com>2010-05-16 23:42:12 (GMT)
commit82d0b03c4f81c2832975d548917c03dbaddeee72 (patch)
treecb2d7ae0c7c8c5870f4c9439453c938a9423afad /examples/declarative/touchinteraction/gestures
parent0aca20bf669ef7e7702ee96d0d0676392cfd1b72 (diff)
downloadQt-82d0b03c4f81c2832975d548917c03dbaddeee72.zip
Qt-82d0b03c4f81c2832975d548917c03dbaddeee72.tar.gz
Qt-82d0b03c4f81c2832975d548917c03dbaddeee72.tar.bz2
Restructure the examples. They are now organized into various
subdirectories to make it easier to locate examples for certain features (e.g. animation) and to distinguish between different types of examples (e.g. very basic examples vs complex demo-like examples).
Diffstat (limited to 'examples/declarative/touchinteraction/gestures')
-rw-r--r--examples/declarative/touchinteraction/gestures/experimental-gestures.qml36
-rw-r--r--examples/declarative/touchinteraction/gestures/gestures.qmlproject16
2 files changed, 52 insertions, 0 deletions
diff --git a/examples/declarative/touchinteraction/gestures/experimental-gestures.qml b/examples/declarative/touchinteraction/gestures/experimental-gestures.qml
new file mode 100644
index 0000000..cb190ea
--- /dev/null
+++ b/examples/declarative/touchinteraction/gestures/experimental-gestures.qml
@@ -0,0 +1,36 @@
+import Qt 4.7
+import Qt.labs.gestures 1.0
+
+// Only works on platforms with Touch support.
+
+Rectangle {
+ id: rect
+ width: 320
+ height: 180
+
+ Text {
+ anchors.centerIn: parent
+ text: "Tap / TapAndHold / Pan / Pinch / Swipe\nOnly works on platforms with Touch support."
+ horizontalAlignment: Text.Center
+ }
+
+ GestureArea {
+ anchors.fill: parent
+ focus: true
+
+ // 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,")")
+ }
+}
diff --git a/examples/declarative/touchinteraction/gestures/gestures.qmlproject b/examples/declarative/touchinteraction/gestures/gestures.qmlproject
new file mode 100644
index 0000000..d4909f8
--- /dev/null
+++ b/examples/declarative/touchinteraction/gestures/gestures.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}