summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2010-03-01 09:11:41 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2010-03-01 09:11:41 (GMT)
commit32cdbb6de84eab0c3619d36f3091e68e93caf3e9 (patch)
tree21cc74a92af94a514ac29c5c392af4da7ada56d6 /examples
parent5d847f395b65b3e6df3eb71ccc1022077465f05c (diff)
downloadQt-32cdbb6de84eab0c3619d36f3091e68e93caf3e9.zip
Qt-32cdbb6de84eab0c3619d36f3091e68e93caf3e9.tar.gz
Qt-32cdbb6de84eab0c3619d36f3091e68e93caf3e9.tar.bz2
use ParentAnimation
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/package/Delegate.qml28
1 files changed, 16 insertions, 12 deletions
diff --git a/examples/declarative/package/Delegate.qml b/examples/declarative/package/Delegate.qml
index 4109633..62198d0 100644
--- a/examples/declarative/package/Delegate.qml
+++ b/examples/declarative/package/Delegate.qml
@@ -2,24 +2,26 @@ import Qt 4.6
//![0]
Package {
- Text { id: listDelegate; width: 200; height: 25; text: "Empty"; Package.name: "list" }
- Text { id: gridDelegate; width: 100; height: 50; text: "Empty"; Package.name: "grid" }
+ Text { id: listDelegate; width: 200; height: 25; text: 'Empty'; Package.name: 'list' }
+ Text { id: gridDelegate; width: 100; height: 50; text: 'Empty'; Package.name: 'grid' }
Rectangle {
id: wrapper
width: 200; height: 25
- color: "lightsteelblue"
+ color: 'lightsteelblue'
+
Text { text: display; anchors.centerIn: parent }
MouseRegion {
anchors.fill: parent
onClicked: {
- if (wrapper.state == "inList")
- wrapper.state = "inGrid";
+ if (wrapper.state == 'inList')
+ wrapper.state = 'inGrid';
else
- wrapper.state = "inList";
+ wrapper.state = 'inList';
}
}
- state: "inList"
+
+ state: 'inList'
states: [
State {
name: 'inList'
@@ -27,15 +29,17 @@ Package {
},
State {
name: 'inGrid'
- ParentChange { target: wrapper; parent: gridDelegate }
- PropertyChanges { target: wrapper; x: 0; y: 0; width: gridDelegate.width; height: gridDelegate.height }
+ ParentChange {
+ target: wrapper; parent: gridDelegate
+ x: 0; y: 0; width: gridDelegate.width; height: gridDelegate.height
+ }
}
]
+
transitions: [
Transition {
- SequentialAnimation {
- ParentAction { target: wrapper }
- NumberAnimation { targets: wrapper; properties: 'x,y,width,height'; duration: 300 }
+ ParentAnimation {
+ NumberAnimation { properties: 'x,y,width,height'; duration: 300 }
}
}
]