summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authormae <qt-info@nokia.com>2010-07-06 13:41:49 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2010-07-13 04:44:32 (GMT)
commit5bb2b79b19ec91a39f550408399ab829be2bc530 (patch)
tree7fd75da01b060d0772e53c2dfc65b7f88c50cab4 /examples
parent35dc9919a0dadaafb72ab4651cc5e9ea29b9aa66 (diff)
downloadQt-5bb2b79b19ec91a39f550408399ab829be2bc530.zip
Qt-5bb2b79b19ec91a39f550408399ab829be2bc530.tar.gz
Qt-5bb2b79b19ec91a39f550408399ab829be2bc530.tar.bz2
Added QDeclarativeSpringAnimation
The QDeclarativeSpringAnimation is a replacement for QDeclarativeSpringFollow. The idea is to remove the Follows quickly. Follows used to have an inSync property. In order to provide an alternative mechanism, the commit also fixes the running property for animations which are controlled by a behavior. Previously running would always return false and never change. Now running does change and indicates that the animation is running indeed. (cherry picked from commit cb406a116bf2237c743ac05882fb06927c70359c)
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/ui-components/dialcontrol/content/Dial.qml19
1 files changed, 10 insertions, 9 deletions
diff --git a/examples/declarative/ui-components/dialcontrol/content/Dial.qml b/examples/declarative/ui-components/dialcontrol/content/Dial.qml
index 2b421bf..b5074a64 100644
--- a/examples/declarative/ui-components/dialcontrol/content/Dial.qml
+++ b/examples/declarative/ui-components/dialcontrol/content/Dial.qml
@@ -50,11 +50,11 @@ Item {
//! [needle_shadow]
Image {
- x: 93
+ x: 96
y: 35
source: "needle_shadow.png"
transform: Rotation {
- origin.x: 11; origin.y: 67
+ origin.x: 9; origin.y: 67
angle: needleRotation.angle
}
}
@@ -62,17 +62,18 @@ Item {
//! [needle]
Image {
id: needle
- x: 95; y: 33
+ x: 98; y: 33
smooth: true
source: "needle.png"
transform: Rotation {
id: needleRotation
- origin.x: 7; origin.y: 65
- angle: -130
- SpringFollow on angle {
- spring: 1.4
- damping: .15
- to: Math.min(Math.max(-130, root.value*2.6 - 130), 133)
+ origin.x: 5; origin.y: 65
+ angle: Math.min(Math.max(-130, root.value*2.6 - 130), 133)
+ Behavior on angle {
+ SpringAnimation {
+ spring: 1.4
+ damping: .15
+ }
}
}
}