diff options
author | Yann Bodson <yann.bodson@nokia.com> | 2009-08-31 01:32:32 (GMT) |
---|---|---|
committer | Yann Bodson <yann.bodson@nokia.com> | 2009-08-31 01:32:32 (GMT) |
commit | 4c4ae4815ed5a2c4862aa91ea20201d49dfd0338 (patch) | |
tree | 52a5fa169457835a61b6e16a59dbbc3edc657113 | |
parent | f5c0745622a914003aa75aaaa1e828854c1c85ba (diff) | |
download | Qt-4c4ae4815ed5a2c4862aa91ea20201d49dfd0338.zip Qt-4c4ae4815ed5a2c4862aa91ea20201d49dfd0338.tar.gz Qt-4c4ae4815ed5a2c4862aa91ea20201d49dfd0338.tar.bz2 |
Add anchor-changes.qml example
-rw-r--r-- | examples/declarative/anchors/anchor-changes.qml | 36 |
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 } + } +} |