QSequentialAnimationGroup Class

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

Header: #include <QSequentialAnimationGroup>
qmake: QT += core
Since: Qt 4.6
Inherits: QAnimationGroup

This class was introduced in Qt 4.6.

Properties

Public Functions

QAbstractAnimation *currentAnimation() const

Signals

void currentAnimationChanged(QAbstractAnimation *current)

Detailed Description

QSequentialAnimationGroup is a QAnimationGroup that runs its animations in sequence, i.e., it starts one animation after another has finished playing. The animations are played in the order they are added to the group (using addAnimation() or insertAnimation()). The animation group finishes when its last animation has finished.

At each moment there is at most one animation that is active in the group; it is returned by currentAnimation(). An empty group has no current animation.

A sequential animation group can be treated as any other animation, i.e., it can be started, stopped, and added to other groups. You can also call addPause() or insertPause() to add a pause to a sequential animation group.

     QSequentialAnimationGroup *group = new QSequentialAnimationGroup;

     group->addAnimation(anim1);
     group->addAnimation(anim2);

     group->start();

In this example, anim1 and anim2 are two already set up QPropertyAnimations.

See also QAnimationGroup, QAbstractAnimation, and The Animation Framework.

Property Documentation

currentAnimation : QAbstractAnimation* const

Returns the animation in the current time.

Access functions:

QAbstractAnimation *currentAnimation() const

Notifier signal:

void currentAnimationChanged(QAbstractAnimation *current)