summaryrefslogtreecommitdiffstats
path: root/examples/declarative/anchors
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/anchors')
-rw-r--r--examples/declarative/anchors/anchor-changes.qml36
1 files changed, 36 insertions, 0 deletions
diff --git a/examples/declarative/anchors/anchor-changes.qml b/examples/declarative/anchors/anchor-changes.qml
new file mode 100644
index 0000000..0c62791
--- /dev/null
+++ b/examples/declarative/anchors/anchor-changes.qml
@@ -0,0 +1,36 @@
+import Qt 4.6
+
+Item {
+ id: Window
+ width: 200; height: 450
+
+ Rectangle {
+ id: Red; color: "Red"
+ anchors.top: parent.top; height: 150
+ width: parent.width
+ }
+
+ Rectangle {
+ id: Orange; color: "Orange"
+ anchors.top: Red.bottom; anchors.bottom: Green.top
+ width: parent.width
+ }
+
+ Rectangle {
+ id: Green; color: "Green"
+ height: 150; anchors.bottom: parent.bottom
+ width: parent.width
+ }
+
+ MouseRegion {
+ anchors.fill: parent
+ onPressed: Window.state = "Pressed"
+ onReleased: Window.state = ""
+ }
+
+ states : State {
+ name: "Pressed"
+ PropertyChanges { target: Orange; color: "Yellow" }
+ AnchorChanges { target: Orange; top: Window.top; bottom: Window.bottom }
+ }
+}