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/states.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/states.qml')
-rw-r--r-- | doc/src/snippets/declarative/states.qml | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/doc/src/snippets/declarative/states.qml b/doc/src/snippets/declarative/states.qml new file mode 100644 index 0000000..7bfb5bd --- /dev/null +++ b/doc/src/snippets/declarative/states.qml @@ -0,0 +1,41 @@ +//![0] +import Qt 4.7 + +Item { + id: myItem + width: 200; height: 200 + + Rectangle { + id: myRect + width: 100; height: 100 + color: "red" + } + + states: [ + State { + name: "moved" + PropertyChanges { + target: myRect + x: 50 + y: 50 + } + } + ] + + MouseArea { + anchors.fill: parent + onClicked: myItem.state = 'moved' + } +//![0] + +//![transitions] +transitions: [ + Transition { + NumberAnimation { properties: "x,y"; duration: 500 } + } +] +//![transitions] + +//![1] +} +//![1] |