summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/declarative/drag.qml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/snippets/declarative/drag.qml')
-rw-r--r--doc/src/snippets/declarative/drag.qml18
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/src/snippets/declarative/drag.qml b/doc/src/snippets/declarative/drag.qml
new file mode 100644
index 0000000..8735d0c
--- /dev/null
+++ b/doc/src/snippets/declarative/drag.qml
@@ -0,0 +1,18 @@
+import Qt 4.6
+
+//! [0]
+Rectangle {
+ id: blurtest; width: 600; height: 200; color: "white"
+ Image {
+ id: pic; source: "qtlogo-64.png"; anchors.verticalCenter: parent.verticalCenter
+ opacity: (600.0-pic.x) / 600;
+ MouseRegion {
+ anchors.fill: parent
+ drag.target: pic
+ drag.axis: "XAxis"
+ drag.minimumX: 0
+ drag.maximumX: blurtest.width-pic.width
+ }
+ }
+}
+//! [0]