diff options
author | mae <qt-info@nokia.com> | 2010-07-06 13:41:49 (GMT) |
---|---|---|
committer | mae <qt-info@nokia.com> | 2010-07-07 11:47:17 (GMT) |
commit | cb406a116bf2237c743ac05882fb06927c70359c (patch) | |
tree | e3b9bbe6b62793e24ef7edb0b1c13f234032177c /doc | |
parent | f5dca266bbf75abe24f39ac8e4d96796529afd77 (diff) | |
download | Qt-cb406a116bf2237c743ac05882fb06927c70359c.zip Qt-cb406a116bf2237c743ac05882fb06927c70359c.tar.gz Qt-cb406a116bf2237c743ac05882fb06927c70359c.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.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/src/declarative/qml-intro.qdoc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/doc/src/declarative/qml-intro.qdoc b/doc/src/declarative/qml-intro.qdoc index 21ce2dd..fbab001 100644 --- a/doc/src/declarative/qml-intro.qdoc +++ b/doc/src/declarative/qml-intro.qdoc @@ -923,16 +923,18 @@ the rotation of the needle image. Notice this piece of code in Dial where the change in \c value modifies the position of the needle. \code - SpringFollow on angle { - spring: 1.4 - damping: .15 - to: Math.min(Math.max(-130, root.value*2.6 - 130), 133) + angle: Math.min(Math.max(-130, root.value*2.6 - 130), 133) + Behavior on angle { + SpringAnimation { + spring: 1.4 + damping: .15 + } } \endcode This is part of the \c needleRotation that rotates the needle and causes the -rotation of its shadow. \l SpringFollow is an element that modifies the value -of that rotation angle \e to and mimics the oscillatory behavior of a spring, +rotation of its shadow. \l SpringAnimation is an element that modifies the value +of that rotation \e angle and mimics the oscillatory behavior of a spring, with the appropriate \e spring constant to control the acceleration and the \e damping to control how quickly the effect dies away. |