diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-06-08 00:50:07 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-06-09 23:36:31 (GMT) |
commit | ce8a3100868e2c545d0af3332e9b801c1fd0bc3f (patch) | |
tree | 3b463fa3262410ad0e3fb9a20d9f1af947502990 /doc/src/snippets/declarative/anchorchanges.qml | |
parent | c85bf4b51331496fcfb8befb4cdcc56d2fa0a213 (diff) | |
download | Qt-ce8a3100868e2c545d0af3332e9b801c1fd0bc3f.zip Qt-ce8a3100868e2c545d0af3332e9b801c1fd0bc3f.tar.gz Qt-ce8a3100868e2c545d0af3332e9b801c1fd0bc3f.tar.bz2 |
Move some example code into snippets/ and add other doc fixes
Diffstat (limited to 'doc/src/snippets/declarative/anchorchanges.qml')
-rw-r--r-- | doc/src/snippets/declarative/anchorchanges.qml | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/doc/src/snippets/declarative/anchorchanges.qml b/doc/src/snippets/declarative/anchorchanges.qml new file mode 100644 index 0000000..6c0a0ad --- /dev/null +++ b/doc/src/snippets/declarative/anchorchanges.qml @@ -0,0 +1,28 @@ +//![0] +import Qt 4.7 + +Item { + id: window + width: 200; height: 200 + + Rectangle { id: myRect; width: 100; height: 100; color: "red" } + + states: State { + name: "reanchored" + + AnchorChanges { + target: myRect + anchors.top: window.top + anchors.bottom: window.bottom + } + PropertyChanges { + target: myRect + anchors.topMargin: 3 + anchors.bottomMargin: 3 + } + } + + MouseArea { anchors.fill: parent; onClicked: window.state = "reanchored" } +} +//![0] + |