![]() |
Home · All Classes · All Functions · Overviews |
[Inherits PropertyAnimation]
The RotationAnimation element allows you to animate rotations. More...
RotationAnimation is a specialized PropertyAnimation that gives control over the direction of rotation.
The RotationAnimation in the following example ensures that we always take the shortest rotation path when switching between our states.
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 } } } transition: Transition { RotationAnimation { direction: RotationAnimation.Shortest } }
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 properties or property.
The direction in which to rotate. Possible values are Numerical, Clockwise, Counterclockwise, or Shortest.
Numerical | Rotate by linearly interpolating between the two numbers. A rotation from 10 to 350 will rotate 340 degrees clockwise. |
Clockwise | Rotate clockwise between the two values |
Counterclockwise | Rotate counterclockwise between the two values |
Shortest | Rotate in the direction that produces the shortest animation path. A rotation from 10 to 350 will rotate 20 degrees counterclockwise. |
The default direction is Shortest.
from : real |
This property holds the starting value. If not set, then the value defined in the start state of the transition.
to : real |
This property holds the ending value. If not set, then the value defined in the end state of the transition or Behavior.
Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies) | Trademarks | Qt 4.7.0 |