summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/declarative/propertyaction.qml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/snippets/declarative/propertyaction.qml')
-rw-r--r--doc/src/snippets/declarative/propertyaction.qml62
1 files changed, 30 insertions, 32 deletions
diff --git a/doc/src/snippets/declarative/propertyaction.qml b/doc/src/snippets/declarative/propertyaction.qml
index dd21d14..f5ae798 100644
--- a/doc/src/snippets/declarative/propertyaction.qml
+++ b/doc/src/snippets/declarative/propertyaction.qml
@@ -41,45 +41,43 @@ import QtQuick 1.0
Row {
-//![transition]
-Item {
- width: 400; height: 400
+ //![transition]
+ Item {
+ width: 400; height: 400
- Rectangle {
- id: rect
- width: 200; height: 100
- color: "red"
+ Rectangle {
+ id: rect
+ width: 200; height: 100
+ color: "red"
- states: State {
- name: "rotated"
- PropertyChanges { target: rect; rotation: 180; transformOrigin: Item.BottomRight }
- }
+ states: State {
+ name: "rotated"
+ PropertyChanges { target: rect; rotation: 180; transformOrigin: Item.BottomRight }
+ }
- transitions: Transition {
- RotationAnimation { duration: 1000; direction: RotationAnimation.Counterclockwise }
- }
+ transitions: Transition {
+ RotationAnimation { duration: 1000; direction: RotationAnimation.Counterclockwise }
+ }
- MouseArea {
- anchors.fill: parent
- onClicked: rect.state = "rotated"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: rect.state = "rotated"
+ }
}
}
-}
-//![transition]
+ //![transition]
-Item {
- width: 300; height: 300
+ Item {
+ width: 300; height: 300
- Image { id: img; source: "pics/qt.png" }
-
-//![standalone]
-SequentialAnimation {
- PropertyAction { target: img; property: "smooth"; value: "true" }
- NumberAnimation { target: img; property: "width"; to: 300; duration: 1000 }
- PropertyAction { target: img; property: "smooth"; value: "false" }
-}
-//![standalone]
-}
+ Image { id: img; source: "pics/qt.png" }
+ //![standalone]
+ SequentialAnimation {
+ PropertyAction { target: img; property: "smooth"; value: "true" }
+ NumberAnimation { target: img; property: "width"; to: 300; duration: 1000 }
+ PropertyAction { target: img; property: "smooth"; value: "false" }
+ }
+ //![standalone]
+ }
}
-