Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquickanimatorjob.cpp File Reference

(60e49dfbe3cf8276aabfcf7bf00dc532dea78baf)

#include "qquickanimatorcontroller_p.h"
#include "qquickanimatorjob_p.h"
#include "qquickanimator_p.h"
#include "qquickanimator_p_p.h"
#include <private/qquickitem_p.h>
#include <private/qanimationgroupjob_p.h>
#include <qcoreapplication.h>
#include <qdebug.h>
#include "moc_qquickanimatorjob_p.cpp"
+ Include dependency graph for qquickanimatorjob.cpp:

Go to the source code of this file.

Classes

struct  QQuickTransformAnimatorHelperStore
 

Functions

 Q_GLOBAL_STATIC (QQuickTransformAnimatorHelperStore, qquick_transform_animatorjob_helper_store)
 
static void qquick_syncback_helper (QAbstractAnimationJob *job)
 
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)
 

Function Documentation

◆ _q_interpolateClockwiseRotation()

QVariant _q_interpolateClockwiseRotation ( qreal & f,
qreal & t,
qreal progress )
extern

Definition at line 1552 of file qquickanimation.cpp.

Referenced by QQuickRotationAnimation::setDirection(), and QQuickRotationAnimatorJob::updateCurrentTime().

+ Here is the caller graph for this function:

◆ _q_interpolateCounterclockwiseRotation()

QVariant _q_interpolateCounterclockwiseRotation ( qreal & f,
qreal & t,
qreal progress )
extern

Definition at line 1563 of file qquickanimation.cpp.

Referenced by QQuickRotationAnimation::setDirection(), and QQuickRotationAnimatorJob::updateCurrentTime().

+ Here is the caller graph for this function:

◆ _q_interpolateShortestRotation()

QVariant _q_interpolateShortestRotation ( qreal & f,
qreal & t,
qreal progress )
extern

\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:

import QtQuick
Item {
width: 300; height: 300
Rectangle {
id: rect
width: 150; height: 100; anchors.centerIn: parent
color: "red"
antialiasing: true
states: State {
name: "rotated"
PropertyChanges { target: rect; rotation: 180 }
}
transitions: Transition {
RotationAnimation { duration: 1000; direction: RotationAnimation.Counterclockwise }
}
}
MouseArea { anchors.fill: parent; onClicked: rect.state = "rotated" }
}

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.

See also
{Animation and Transitions in Qt Quick}, {Qt Quick Examples - Animation}

Definition at line 1537 of file qquickanimation.cpp.

Referenced by QQuickRotationAnimation::setDirection(), and QQuickRotationAnimatorJob::updateCurrentTime().

+ Here is the caller graph for this function:

◆ Q_GLOBAL_STATIC()

Q_GLOBAL_STATIC ( QQuickTransformAnimatorHelperStore ,
qquick_transform_animatorjob_helper_store  )

◆ qquick_syncback_helper()

static void qquick_syncback_helper ( QAbstractAnimationJob * job)
static

Definition at line 205 of file qquickanimatorjob.cpp.

References QAbstractAnimationJob::isGroup(), QAbstractAnimationJob::isRenderThreadJob(), and qquick_syncback_helper().

Referenced by qquick_syncback_helper().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: