diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-03-04 23:53:09 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-03-04 23:53:09 (GMT) |
commit | 8274de2d952181d27f24ec9bee7e353e35dc39db (patch) | |
tree | 55153a5fc4441e4954a42df6b117ea688d5d8769 /src | |
parent | 2701b8389eb9cfbdd65b87b00e5406187c57b297 (diff) | |
download | Qt-8274de2d952181d27f24ec9bee7e353e35dc39db.zip Qt-8274de2d952181d27f24ec9bee7e353e35dc39db.tar.gz Qt-8274de2d952181d27f24ec9bee7e353e35dc39db.tar.bz2 |
RotationAnimation docs + test.
Task-number: QTBUG-8613
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/util/qdeclarativeanimation.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index 76b6a58..d1a3770 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -1341,24 +1341,26 @@ void QDeclarativeVector3dAnimation::setTo(QVector3D t) \brief The RotationAnimation element allows you to animate rotations. RotationAnimation is a specialized PropertyAnimation that gives control - over the direction of rotation. + over the direction of rotation. By default, it will rotate + via the shortest path; for example, a rotation from 20 to 340 degrees will + rotation 40 degrees counterclockwise. - The RotationAnimation in the following example ensures that we always take - the shortest rotation path when switching between our states. + When used in a transition RotationAnimation will rotate all + properties named "rotation" or "angle". You can override this by providing + your own properties via \c properties or \c property. + + In the following example we use RotationAnimation to animate the rotation + between states via the shortest path. \qml states: { State { name: "180"; PropertyChanges { target: myItem; rotation: 180 } } - State { name: "-180"; PropertyChanges { target: myItem; rotation: -180 } } - State { name: "180"; PropertyChanges { target: myItem; rotation: 270 } } + State { name: "90"; PropertyChanges { target: myItem; rotation: 90 } } + State { name: "-90"; PropertyChanges { target: myItem; rotation: -90 } } } transition: Transition { - RotationAnimation { direction: RotationAnimation.Shortest } + RotationAnimation { } } \endqml - - By default, when used in a transition RotationAnimation will rotate all - properties named "rotation" or "angle". You can override this by providing - your own properties via \c properties or \c property. */ /*! |