summaryrefslogtreecommitdiffstats
path: root/doc/src
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-05-01 01:59:54 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-05-01 01:59:54 (GMT)
commit349d37aff07ac86c5b70f7ed76c2241b4c4f3637 (patch)
tree26e420215ad3b1d45ba85ad6c070a12b6fa74631 /doc/src
parent94dff487709583068bdc002a955cf5b423cae614 (diff)
downloadQt-349d37aff07ac86c5b70f7ed76c2241b4c4f3637.zip
Qt-349d37aff07ac86c5b70f7ed76c2241b4c4f3637.tar.gz
Qt-349d37aff07ac86c5b70f7ed76c2241b4c4f3637.tar.bz2
More format changes
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/snippets/declarative/drag.qml16
-rw-r--r--doc/src/snippets/declarative/mouseregion.qml23
2 files changed, 39 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..3a573ad
--- /dev/null
+++ b/doc/src/snippets/declarative/drag.qml
@@ -0,0 +1,16 @@
+//! [0]
+Rect {
+ 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: "x"
+ drag.xmin: 0
+ drag.xmax: blurtest.width-pic.width
+ }
+ }
+}
+//! [0]
diff --git a/doc/src/snippets/declarative/mouseregion.qml b/doc/src/snippets/declarative/mouseregion.qml
new file mode 100644
index 0000000..5c1afe6
--- /dev/null
+++ b/doc/src/snippets/declarative/mouseregion.qml
@@ -0,0 +1,23 @@
+Rect { width: 200; height: 100
+HorizontalLayout {
+//! [0]
+Rect { width: 100; height: 100; color: "green"
+ MouseRegion { anchors.fill: parent; onClicked: { parent.color = 'red' } }
+}
+//! [0]
+//! [1]
+Rect {
+ width: 100; height: 100; color: "green"
+ MouseRegion {
+ anchors.fill: parent
+ onClicked: {
+ if (mouse.button == Qt.RightButton)
+ parent.color = 'blue';
+ else
+ parent.color = 'red';
+ }
+ }
+}
+//! [1]
+}
+}