The RotationAnimator type animates the rotation of an Item. More...
Import Statement: | import QtQuick 2.15 |
Since: | Qt 5.2 |
Inherits: |
Animator types are different from normal Animation types. When using an Animator, the animation can be run in the render thread and the property value will jump to the end when the animation is complete.
The value of Item::rotation is updated after the animation has finished.
The following snippet shows how to use a RotationAnimator together with a Rectangle item.
Rectangle { id: rotatingBox width: 50 height: 50 color: "lightsteelblue" RotationAnimator { target: rotatingBox; from: 0; to: 360; duration: 1000 running: true } }
It is also possible to use the on
keyword to tie the RotationAnimator directly to the rotation
property of an Item instance.
Rectangle { width: 50 height: 50 color: "lightsteelblue" RotationAnimator on rotation { from: 0; to: 360; duration: 1000 } }
See also Item::transformOrigin and ScaleAnimator.
direction : enumeration
This property holds the direction of the rotation.
Possible values are:
© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-5.15/qml-qtquick-rotationanimator.html