6.0.0-rc4Source

QSequentialAnimationGroup Class

The QSequentialAnimationGroup class provides a sequential group of animations. More…

Header#include <QSequentialAnimationGroup>
CMaketarget_link_libraries(app PRIVATE Nt::Core)
ModuleNt Core C++ Classes
Since4.6
InheritsQAnimationGroup

List of all members, including inherited members

Public Functions

Reimplemented Public Functions

intduration() const

Signals

Reimplemented Protected Functions

Detailed Description

A sequential group runs its animations one after another, in the order they were added: when one has finished, the next starts. The group is finished when the last one is.

auto *group = new QSequentialAnimationGroup;
group->addAnimation(fadeOut);
group->addPause(100);
group->addAnimation(move);
group->addAnimation(fadeIn);
group->start();

currentAnimation() is the animation that runs now, and currentAnimationChanged() tells when the group moves on.

See also QParallelAnimationGroup and QPauseAnimation.

Differences from Qt

The current animation is not a bindable property.

Member Function Documentation

[explicit] QSequentialAnimationGroup::QSequentialAnimationGroup(QObject *parent = nullptr)

Constructs a sequential group with the given parent.

[override] QSequentialAnimationGroup::~QSequentialAnimationGroup()

Destroys the group and the animations in it.

QPauseAnimation * QSequentialAnimationGroup::addPause(int msecs)

Adds a pause of msecs milliseconds at the end of the group and returns it.

See also insertPause() and QAnimationGroup::addAnimation().

QAbstractAnimation * QSequentialAnimationGroup::currentAnimation() const

Returns the animation that the group is at: the one that runs, or would if the group did. It is nullptr for a group without animations.

See also currentAnimationChanged().

[signal] void QSequentialAnimationGroup::currentAnimationChanged(QAbstractAnimation *current)

This signal is emitted when the group moves on to another animation, with the animation that now runs in current. It is nullptr when the group has none.

See also currentAnimation().

[override] int QSequentialAnimationGroup::duration() const

Reimplements QAnimationGroup::duration().

Returns the sum of the durations of the animations, with their loops, or -1 while the duration of one of them is undefined.

[override, protected] bool QSequentialAnimationGroup::event(QEvent *event)

Reimplements QAnimationGroup::event().

QPauseAnimation * QSequentialAnimationGroup::insertPause(int index, int msecs)

Inserts a pause of msecs milliseconds into the group at index and returns it, or nullptr if the index is out of range.

See also addPause() and QAnimationGroup::insertAnimation().

[override, protected] void QSequentialAnimationGroup::updateCurrentTime(int currentTime)

Reimplements QAnimationGroup::updateCurrentTime().

[override, protected] void QSequentialAnimationGroup::updateDirection(QAbstractAnimation::Direction direction)

Reimplements QAnimationGroup::updateDirection().

[override, protected] void QSequentialAnimationGroup::updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState)

Reimplements QAnimationGroup::updateState().