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
- currentAnimation : QAbstractAnimation* const
- 6 properties inherited from QAbstractAnimation
- 1 property inherited from QObject
Public Functions
QSequentialAnimationGroup(QObject *parent = nullptr) | |
virtual | ~QSequentialAnimationGroup() |
QPauseAnimation * | addPause(int msecs) |
QAbstractAnimation * | currentAnimation() const |
QPauseAnimation * | insertPause(int index, int msecs) |
Reimplemented Public Functions
virtual int | duration() const override |
- 8 public functions inherited from QAnimationGroup
- 11 public functions inherited from QAbstractAnimation
- 31 public functions inherited from QObject
Signals
void | currentAnimationChanged(QAbstractAnimation *current) |
- 4 signals inherited from QAbstractAnimation
- 2 signals inherited from QObject
Reimplemented Protected Functions
virtual bool | event(QEvent *event) override |
virtual void | updateCurrentTime(int currentTime) override |
virtual void | updateDirection(QAbstractAnimation::Direction direction) override |
virtual void | updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) override |
- 1 protected function inherited from QAnimationGroup
- 4 protected functions inherited from QAbstractAnimation
- 9 protected functions inherited from QObject
Related Non-Members
typedef | QObjectList |
QList<T> | qFindChildren(const QObject *obj, const QRegExp ®Exp) |
T | qobject_cast(QObject *object) |
T | qobject_cast(const QObject *object) |
Macros
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
Q_CLASSINFO(Name, Value) | |
Q_DISABLE_COPY(Class) | |
Q_DISABLE_COPY_MOVE(Class) | |
Q_DISABLE_MOVE(Class) | |
Q_EMIT | |
Q_ENUM(...) | |
Q_ENUM_NS(...) | |
Q_FLAG(...) | |
Q_FLAG_NS(...) | |
Q_GADGET | |
Q_INTERFACES(...) | |
Q_INVOKABLE | |
Q_NAMESPACE | |
Q_OBJECT | |
Q_PROPERTY(...) | |
Q_REVISION | |
Q_SET_OBJECT_NAME(Object) | |
Q_SIGNAL | |
Q_SIGNALS | |
Q_SLOT | |
Q_SLOTS |
Additional Inherited Members
- 6 public slots inherited from QAbstractAnimation
- 1 public slot inherited from QObject
- 10 static public members inherited from QObject
- 1 protected function inherited from QAnimationGroup
- 4 protected functions inherited from QAbstractAnimation
- 9 protected functions inherited from QObject
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) |
Member Function Documentation
QSequentialAnimationGroup::QSequentialAnimationGroup(QObject *parent = nullptr)
Constructs a QSequentialAnimationGroup. parent is passed to QObject's constructor.
[signal]
void QSequentialAnimationGroup::currentAnimationChanged(QAbstractAnimation *current)
QSequentialAnimationGroup emits this signal when currentAnimation has been changed. current is the current animation.
Note: Notifier signal for property currentAnimation.
See also currentAnimation().
[virtual]
QSequentialAnimationGroup::~QSequentialAnimationGroup()
Destroys the animation group. It will also destroy all its animations.
QPauseAnimation *QSequentialAnimationGroup::addPause(int msecs)
Adds a pause of msecs to this animation group. The pause is considered as a special type of animation, thus animationCount will be increased by one.
See also insertPause() and QAnimationGroup::addAnimation().
[override virtual]
int QSequentialAnimationGroup::duration() const
Reimplements: QAbstractAnimation::duration() const.
[override virtual protected]
bool QSequentialAnimationGroup::event(QEvent *event)
Reimplements: QAnimationGroup::event(QEvent *event).
QPauseAnimation *QSequentialAnimationGroup::insertPause(int index, int msecs)
Inserts a pause of msecs milliseconds at index in this animation group.
See also addPause() and QAnimationGroup::insertAnimation().
[override virtual protected]
void QSequentialAnimationGroup::updateCurrentTime(int currentTime)
Reimplements: QAbstractAnimation::updateCurrentTime(int currentTime).
[override virtual protected]
void QSequentialAnimationGroup::updateDirection(QAbstractAnimation::Direction direction)
Reimplements: QAbstractAnimation::updateDirection(QAbstractAnimation::Direction direction).
[override virtual protected]
void QSequentialAnimationGroup::updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState)
Reimplements: QAbstractAnimation::updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState).