diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2009-04-27 10:32:25 (GMT) |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2009-04-27 10:32:25 (GMT) |
commit | e793ab29e651a7b07354224a82343d66c265f361 (patch) | |
tree | 066b8f7207132bfbd1f9fe039c723ccd75c78412 /examples/declarative/behaviours | |
parent | 40983ad8b9209c41124c93b8a3c1517f93ae17d2 (diff) | |
download | Qt-e793ab29e651a7b07354224a82343d66c265f361.zip Qt-e793ab29e651a7b07354224a82343d66c265f361.tar.gz Qt-e793ab29e651a7b07354224a82343d66c265f361.tar.bz2 |
Converted the examples.
Diffstat (limited to 'examples/declarative/behaviours')
-rw-r--r-- | examples/declarative/behaviours/MyRect.qml | 15 | ||||
-rw-r--r-- | examples/declarative/behaviours/test.qml | 140 |
2 files changed, 114 insertions, 41 deletions
diff --git a/examples/declarative/behaviours/MyRect.qml b/examples/declarative/behaviours/MyRect.qml index e40bd1b..dc9a094 100644 --- a/examples/declarative/behaviours/MyRect.qml +++ b/examples/declarative/behaviours/MyRect.qml @@ -1,4 +1,11 @@ -<Rect radius="15" pen.color="black" width="100" height="100" id="Page"> - <MouseRegion anchors.fill="{parent}" onClicked="bluerect.parent = Page; bluerect.x=0" /> -</Rect> - +Rect { + radius: 15 + pen.color: "black" + width: 100 + height: 100 + id: Page + MouseRegion { + anchors.fill: parent + onClicked: { bluerect.parent = Page; bluerect.x=0 } + } +} diff --git a/examples/declarative/behaviours/test.qml b/examples/declarative/behaviours/test.qml index a544028..bb7109e 100644 --- a/examples/declarative/behaviours/test.qml +++ b/examples/declarative/behaviours/test.qml @@ -1,37 +1,103 @@ -<Rect color="lightsteelblue" width="800" height="600" id="Page"> - <MouseRegion anchors.fill="{parent}" onClicked="bluerect.parent = Page; bluerect.x = mouseX;" /> - - <MyRect color="green" x="200" y="200" /> - <MyRect color="red" x="400" y="200" /> - <MyRect color="yellow" x="400" y="400" /> - <MyRect color="orange" x="400" y="500" /> - <MyRect color="pink" x="400" y="0" /> - <MyRect color="lightsteelblue" x="100" y="500" /> - <MyRect color="black" x="0" y="200" /> - <MyRect color="white" x="400" y="0" /> - - <Rect color="blue" x="0" y="0" width="100" height="100" id="bluerect"> - <x> - <Behaviour> - <SequentialAnimation> - <NumericAnimation target="{bluerect}" properties="y" from="0" to="10" easing="easeOutBounce(amplitude:30)" duration="250" /> - <NumericAnimation target="{bluerect}" properties="y" from="10" to="0" easing="easeOutBounce(amplitude:30)" duration="250" /> - </SequentialAnimation> - <NumericAnimation target="{bluerect}" property="x" duration="500" /> - </Behaviour> - </x> - - <parent> - <Behaviour> - <SequentialAnimation> - <NumericAnimation target="{bluerect}" properties="opacity" to="0" duration="150" /> - <SetPropertyAction target="{bluerect}" property="parent" /> - <NumericAnimation target="{bluerect}" properties="opacity" to="1" duration="150"/> - </SequentialAnimation> - </Behaviour> - </parent> - - </Rect> - - -</Rect> +Rect { + color: "lightsteelblue" + width: 800 + height: 600 + id: Page + MouseRegion { + anchors.fill: parent + onClicked: { bluerect.parent = Page; bluerect.x = mouseX; } + } + MyRect { + color: "green" + x: 200 + y: 200 + } + MyRect { + color: "red" + x: 400 + y: 200 + } + MyRect { + color: "yellow" + x: 400 + y: 400 + } + MyRect { + color: "orange" + x: 400 + y: 500 + } + MyRect { + color: "pink" + x: 400 + y: 0 + } + MyRect { + color: "lightsteelblue" + x: 100 + y: 500 + } + MyRect { + color: "black" + x: 0 + y: 200 + } + MyRect { + color: "white" + x: 400 + y: 0 + } + Rect { + color: "blue" + x: 0 + y: 0 + width: 100 + height: 100 + id: bluerect + x: Behaviour { + SequentialAnimation { + NumericAnimation { + target: bluerect + properties: "y" + from: 0 + to: 10 + easing: "easeOutBounce(amplitude:30)" + duration: 250 + } + NumericAnimation { + target: bluerect + properties: "y" + from: 10 + to: 0 + easing: "easeOutBounce(amplitude:30)" + duration: 250 + } + } + NumericAnimation { + target: bluerect + property: "x" + duration: 500 + } + } + parent: Behaviour { + SequentialAnimation { + NumericAnimation { + target: bluerect + properties: "opacity" + to: 0 + duration: 150 + } + SetPropertyAction { + target: bluerect + property: "parent" + } + NumericAnimation { + target: bluerect + properties: "opacity" + to: 1 + duration: 150 + } + } + } + } +} |