From 4c4ae4815ed5a2c4862aa91ea20201d49dfd0338 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Mon, 31 Aug 2009 11:32:32 +1000 Subject: Add anchor-changes.qml example --- examples/declarative/anchors/anchor-changes.qml | 36 +++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 examples/declarative/anchors/anchor-changes.qml 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 } + } +} -- cgit v0.12