diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-07-12 05:34:21 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-07-12 05:35:15 (GMT) |
commit | cbc7a0251a727827418707c7a05ea44241a06efb (patch) | |
tree | f825bde50cfecae52172cb0bee666f42c817c629 /tests | |
parent | d69671cf3fc6bf51e7cbb322dce51fa0719ae6bc (diff) | |
download | Qt-cbc7a0251a727827418707c7a05ea44241a06efb.zip Qt-cbc7a0251a727827418707c7a05ea44241a06efb.tar.gz Qt-cbc7a0251a727827418707c7a05ea44241a06efb.tar.bz2 |
Remove use of SpringFollow and SmoothedFollow in qmlvisual test
(onvert to use SpringAnimation and SmoothedAnimation instead)
Diffstat (limited to 'tests')
3 files changed, 42 insertions, 31 deletions
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/smoothedfollow.qml b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/smoothedfollow.qml index 7ca0ca5..0df727b 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/smoothedfollow.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/smoothedfollow.qml @@ -14,27 +14,27 @@ Rectangle { } Rectangle { - width: 50; height: 20; y: 60; color: "red" - SmoothedFollow on x { to: rect.x; velocity: 400; enabled: true } + width: 50; height: 20; x: rect.x; y: 60; color: "red" + Behavior on x { SmoothedAnimation { velocity: 400 } } } Rectangle { - width: 50; height: 20; y: 90; color: "yellow" - SmoothedFollow on x { to: rect.x; velocity: 300; reversingMode: SmoothedAnimation.Immediate; enabled: true } + width: 50; height: 20; x: rect.x; y: 90; color: "yellow" + Behavior on x { SmoothedAnimation { velocity: 300; reversingMode: SmoothedAnimation.Immediate } } } Rectangle { - width: 50; height: 20; y: 120; color: "green" - SmoothedFollow on x { to: rect.x; reversingMode: SmoothedAnimation.Sync; enabled: true } + width: 50; height: 20; x: rect.x; y: 120; color: "green" + Behavior on x { SmoothedAnimation { reversingMode: SmoothedAnimation.Sync } } } Rectangle { - width: 50; height: 20; y: 150; color: "purple" - SmoothedFollow on x { to: rect.x; maximumEasingTime: 200; enabled: true } + width: 50; height: 20; x: rect.x; y: 150; color: "purple" + Behavior on x { SmoothedAnimation { maximumEasingTime: 200 } } } Rectangle { - width: 50; height: 20; y: 180; color: "blue" - SmoothedFollow on x { to: rect.x; duration: 300; enabled: true } + width: 50; height: 20; x: rect.x; y: 180; color: "blue" + Behavior on x { SmoothedAnimation { duration: 300 } } } } diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringfollow/clock.qml b/tests/auto/declarative/qmlvisual/qdeclarativespringfollow/clock.qml index d981763..c64497a 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativespringfollow/clock.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativespringfollow/clock.qml @@ -22,10 +22,11 @@ Rectangle { smooth: true transform: Rotation { id: hourRotation - origin.x: 7.5; origin.y: 73; angle: 0 - SpringFollow on angle { - spring: 2; damping: 0.2; modulus: 360 - to: (clock.hours * 30) + (clock.minutes * 0.5) + origin.x: 7.5; origin.y: 73 + angle: (clock.hours * 30) + (clock.minutes * 0.5) + + Behavior on angle { + SpringAnimation { spring: 2; damping: 0.2; modulus: 360 } } } } @@ -36,10 +37,11 @@ Rectangle { smooth: true transform: Rotation { id: minuteRotation - origin.x: 6.5; origin.y: 83; angle: 0 - SpringFollow on angle { - spring: 2; damping: 0.2; modulus: 360 - to: clock.minutes * 6 + origin.x: 6.5; origin.y: 83 + angle: clock.minutes * 6 + + Behavior on angle { + SpringAnimation { spring: 2; damping: 0.2; modulus: 360 } } } } @@ -50,10 +52,11 @@ Rectangle { smooth: true transform: Rotation { id: secondRotation - origin.x: 2.5; origin.y: 80; angle: 0 - SpringFollow on angle { - spring: 5; damping: 0.25; modulus: 360 - to: clock.seconds * 6 + origin.x: 2.5; origin.y: 80 + angle: clock.seconds * 6 + + Behavior on angle { + SpringAnimation { spring: 5; damping: 0.25; modulus: 360 } } } } diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringfollow/follow.qml b/tests/auto/declarative/qmlvisual/qdeclarativespringfollow/follow.qml index cabdce7..05b93df 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativespringfollow/follow.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativespringfollow/follow.qml @@ -3,6 +3,7 @@ import Qt 4.7 Rectangle { color: "#ffffff" width: 320; height: 240 + Rectangle { id: rect color: "#00ff00" @@ -25,22 +26,22 @@ Rectangle { Rectangle { color: "#ff0000" x: rect.width; width: rect.width; height: 20 - y: 200 - SpringFollow on y { to: rect.y; velocity: 200 } + y: rect.y + Behavior on y { SpringAnimation { velocity: 200 } } } // Spring Rectangle { color: "#ff0000" x: rect.width * 2; width: rect.width/2; height: 20 - y: 200 - SpringFollow on y { to: rect.y; spring: 1.0; damping: 0.2 } + y: rect.y + Behavior on y { SpringAnimation { spring: 1.0; damping: 0.2 } } } Rectangle { color: "#880000" x: rect.width * 2.5; width: rect.width/2; height: 20 - y: 200 - SpringFollow on y { to: rect.y; spring: 1.0; damping: 0.2; mass: 3.0 } // "heavier" object + y: rect.y + Behavior on y { SpringAnimation { spring: 1.0; damping: 0.2; mass: 3.0 } } // "heavier" object } // Follow mouse @@ -49,15 +50,22 @@ Rectangle { anchors.fill: parent Rectangle { id: ball + property int targetX: mouseRegion.mouseX - 10 + property int targetY: mouseRegion.mouseY - 10 + + x: targetX + y: targetY width: 20; height: 20 radius: 10 color: "#0000ff" - SpringFollow on x { id: f1; to: mouseRegion.mouseX-10; spring: 1.0; damping: 0.05; epsilon: 0.25 } - SpringFollow on y { id: f2; to: mouseRegion.mouseY-10; spring: 1.0; damping: 0.05; epsilon: 0.25 } + + Behavior on x { SpringAnimation { spring: 1.0; damping: 0.05; epsilon: 0.25 } } + Behavior on y { SpringAnimation { spring: 1.0; damping: 0.05; epsilon: 0.25 } } + states: [ State { name: "following" - when: !f1.inSync || !f2.inSync + when: ball.x != ball.targetX || ball.y != ball.targetY PropertyChanges { target: ball; color: "#ff0000" } } ] |