summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/declarative/states.qml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/snippets/declarative/states.qml')
-rw-r--r--doc/src/snippets/declarative/states.qml38
1 files changed, 9 insertions, 29 deletions
diff --git a/doc/src/snippets/declarative/states.qml b/doc/src/snippets/declarative/states.qml
index c3b1796e2c..127e3a7f76 100644
--- a/doc/src/snippets/declarative/states.qml
+++ b/doc/src/snippets/declarative/states.qml
@@ -40,42 +40,22 @@
****************************************************************************/
//![0]
import Qt 4.7
-
-Item {
- id: myItem
+
+Rectangle {
+ id: myRect
width: 200; height: 200
+ color: "red"
- Rectangle {
- id: myRect
- width: 100; height: 100
- color: "red"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: myRect.state = 'moved'
}
states: [
State {
name: "moved"
- PropertyChanges {
- target: myRect
- x: 50
- y: 50
- }
+ 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]
+//![0]