summaryrefslogtreecommitdiffstats
path: root/examples/declarative/behaviours
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/behaviours')
-rw-r--r--examples/declarative/behaviours/MyRect.qml13
-rw-r--r--examples/declarative/behaviours/behavior.qml6
-rw-r--r--examples/declarative/behaviours/test.qml102
3 files changed, 3 insertions, 118 deletions
diff --git a/examples/declarative/behaviours/MyRect.qml b/examples/declarative/behaviours/MyRect.qml
deleted file mode 100644
index caf0d83..0000000
--- a/examples/declarative/behaviours/MyRect.qml
+++ /dev/null
@@ -1,13 +0,0 @@
-import Qt 4.6
-
-Rectangle {
- radius: 15
- border.color: "black"
- width: 100
- height: 100
- id: page
- MouseArea {
- anchors.fill: parent
- onClicked: { bluerect.parent = page; bluerect.x=0 }
- }
-}
diff --git a/examples/declarative/behaviours/behavior.qml b/examples/declarative/behaviours/behavior.qml
index 2732c0a..c84bf62 100644
--- a/examples/declarative/behaviours/behavior.qml
+++ b/examples/declarative/behaviours/behavior.qml
@@ -50,12 +50,12 @@ Rectangle {
radius: 5
border.width: 10; border.color: "white";
x: 100-37; y: 100-25
- x: Behavior { NumberAnimation { duration: 300 } }
- y: Behavior { NumberAnimation { duration: 300 } }
+ Behavior on x { NumberAnimation { duration: 300 } }
+ Behavior on y { NumberAnimation { duration: 300 } }
Text {
id: focusText
text: focusRect.text;
- text: Behavior {
+ Behavior on text {
SequentialAnimation {
NumberAnimation { target: focusText; property: "opacity"; to: 0; duration: 150 }
PropertyAction {}
diff --git a/examples/declarative/behaviours/test.qml b/examples/declarative/behaviours/test.qml
deleted file mode 100644
index 8fffd59..0000000
--- a/examples/declarative/behaviours/test.qml
+++ /dev/null
@@ -1,102 +0,0 @@
-import Qt 4.6
-
-Rectangle {
- color: "lightsteelblue"
- width: 800
- height: 600
- id: page
- MouseArea {
- anchors.fill: parent
- onClicked: { bluerect.parent = page; console.log(mouseX); 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
- }
- Rectangle {
- color: "blue"
- x: 0
- y: 0
- width: 100
- height: 100
- id: bluerect
- x: Behavior {
- ParallelAnimation {
- SequentialAnimation {
- NumberAnimation {
- target: bluerect
- property: "y"
- from: 0
- to: 10
- easing.type: "OutBounce"
- easing.amplitude: 30
- duration: 250
- }
- NumberAnimation {
- target: bluerect
- property: "y"
- from: 10
- to: 0
- easing.type: "OutBounce"
- easing.amplitude: 30
- duration: 250
- }
- }
- NumberAnimation { duration: 500 }
- }
- }
- parent: Behavior {
- SequentialAnimation {
- NumberAnimation {
- target: bluerect
- property: "opacity"
- to: 0
- duration: 150
- }
- PropertyAction {}
- NumberAnimation {
- target: bluerect
- property: "opacity"
- to: 1
- duration: 150
- }
- }
- }
- }
-}