![]() |
Qt 6.x
The Qt SDK
|
\qmltype Transition \instantiates QQuickTransition \inqmlmodule QtQuick More...
Public Attributes | |
QQuickTransitionManager * | manager |
![]() | |
SelfDeletable | m_selfDeletable |
\qmltype Transition \instantiates QQuickTransition \inqmlmodule QtQuick
Defines animated transitions that occur on state changes.
A Transition defines the animations to be applied when a \l State change occurs.
For example, the following \l Rectangle has two states: the default state, and an added "moved" state. In the "moved state, the rectangle's position changes to (50, 50). The added Transition specifies that when the rectangle changes between the default and the "moved" state, any changes to the \c x and \c y properties should be animated, using an \c Easing.InOutQuad. \snippet qml/transition.qml 0 Notice the example does not require \l{PropertyAnimation::}{to} and \l{PropertyAnimation::}{from} values for the NumberAnimation. As a convenience, these properties are automatically set to the values of \c x and \c y before and after the state change; the \c from values are provided by the current values of \c x and \c y, and the \c to values are provided by the PropertyChanges object. If you wish, you can provide \l{PropertyAnimation::}{to} and \l{PropertyAnimation::}{from} values anyway to override the default values. By default, a Transition's animations are applied for any state change in the parent item. The Transition \l {Transition::}{from} and \l {Transition::}{to} values can be set to restrict the animations to only be applied when changing from one particular state to another. Top-level animations within a transition are run in parallel. To run them sequentially, define them within a SequentialAnimation: \snippet qml/transition-reversible.qml sequential animations To define multiple Transitions, specify \l Item::transitions as a list: \snippet qml/transitions-list.qml list of transitions If multiple Transitions are specified, only a single (best-matching) Transition will be applied for any particular state change. In the example above, if the Rectangle enters a state other than \c "middleRight" or \c "bottomLeft", the third Transition will be carried out, meaning the icon will be moved to the starting point.
If a state change has a Transition that matches the same property as a \l Behavior, the Transition animation overrides the \l Behavior for that state change.
Definition at line 73 of file qquicktransition.cpp.
|
inline |
Definition at line 76 of file qquicktransition.cpp.
|
overrideprotectedvirtual |
Reimplemented from QAbstractAnimationJob.
Definition at line 165 of file qquicktransition.cpp.
References QAbstractAnimationJob::Backward, QAbstractAnimationJob::currentLoopTime(), QAbstractAnimationJob::direction(), QParallelAnimationGroupJob::duration(), QAbstractAnimationJob::Forward, manager, newState(), QAbstractAnimationJob::Stopped, and QParallelAnimationGroupJob::updateState().
QQuickTransitionManager* ParallelAnimationWrapper::manager |
Definition at line 77 of file qquicktransition.cpp.
Referenced by updateState().