![]() |
Qt 6.x
The Qt SDK
|
#include "qquickanimation_p.h"
#include "qquickanimation_p_p.h"
#include "qquickanimatorjob_p.h"
#include <private/qquickstatechangescript_p.h>
#include <private/qqmlcontext_p.h>
#include <qqmlpropertyvaluesource.h>
#include <qqml.h>
#include <qqmlinfo.h>
#include <qqmlexpression.h>
#include <private/qqmlstringconverters_p.h>
#include <private/qqmlglobal_p.h>
#include <private/qqmlmetatype_p.h>
#include <private/qqmlvaluetype_p.h>
#include <private/qqmlproperty_p.h>
#include <private/qqmlengine_p.h>
#include <qvariant.h>
#include <qcolor.h>
#include <qfile.h>
#include "private/qparallelanimationgroupjob_p.h"
#include "private/qsequentialanimationgroupjob_p.h"
#include <QtCore/qset.h>
#include <QtCore/qrect.h>
#include <QtCore/qpoint.h>
#include <QtCore/qsize.h>
#include <QtCore/qmath.h>
#include "moc_qquickanimation_p.cpp"
Go to the source code of this file.
Functions | |
QVariant | _q_interpolateShortestRotation (qreal &f, qreal &t, qreal progress) |
\qmltype RotationAnimation \instantiates QQuickRotationAnimation \inqmlmodule QtQuick\inherits PropertyAnimation | |
QVariant | _q_interpolateClockwiseRotation (qreal &f, qreal &t, qreal progress) |
QVariant | _q_interpolateCounterclockwiseRotation (qreal &f, qreal &t, qreal progress) |
Definition at line 1552 of file qquickanimation.cpp.
Referenced by QQuickRotationAnimation::setDirection(), and QQuickRotationAnimatorJob::updateCurrentTime().
Definition at line 1563 of file qquickanimation.cpp.
Referenced by QQuickRotationAnimation::setDirection(), and QQuickRotationAnimatorJob::updateCurrentTime().
\qmltype RotationAnimation \instantiates QQuickRotationAnimation \inqmlmodule QtQuick\inherits PropertyAnimation
Animates changes in rotation values.
RotationAnimation is a specialized PropertyAnimation that gives control over the direction of rotation during an animation.
By default, it rotates in the direction of the numerical change; a rotation from 0 to 240 will rotate 240 degrees clockwise, while a rotation from 240 to 0 will rotate 240 degrees counterclockwise. The \l direction property can be set to specify the direction in which the rotation should occur.
In the following example we use RotationAnimation to animate the rotation between states via the shortest path:
Notice the RotationAnimation did not need to set a target
value. As a convenience, when used in a transition, RotationAnimation will rotate all properties named "rotation" or "angle". You can override this by providing your own properties via \l {PropertyAnimation::properties}{properties} or \l {PropertyAnimation::property}{property}.
Also, note the \l Rectangle will be rotated around its default \l {Item::}{transformOrigin} (which is Item.Center
). To use a different transform origin, set the origin in the PropertyChanges object and apply the change at the start of the animation using PropertyAction. See the PropertyAction documentation for more details.
Like any other animation type, a RotationAnimation can be applied in a number of ways, including transitions, behaviors and property value sources. The \l {Animation and Transitions in Qt Quick} documentation shows a variety of methods for creating animations.
Definition at line 1537 of file qquickanimation.cpp.
Referenced by QQuickRotationAnimation::setDirection(), and QQuickRotationAnimatorJob::updateCurrentTime().