
We bake cookies in your browser for a better experience. Using this site means that you consent.Read More
TheQAnimationGroup class is an abstract base class for groups of animations.More...
| Header: | #include <QAnimationGroup> |
| Since: | Qt 4.6 |
| Inherits: | QAbstractAnimation |
| Inherited By: |
| QAnimationGroup(QObject * parent = 0) | |
| ~QAnimationGroup() | |
| void | addAnimation(QAbstractAnimation * animation) |
| QAbstractAnimation * | animationAt(int index) const |
| int | animationCount() const |
| void | clear() |
| int | indexOfAnimation(QAbstractAnimation * animation) const |
| void | insertAnimation(int index, QAbstractAnimation * animation) |
| void | removeAnimation(QAbstractAnimation * animation) |
| QAbstractAnimation * | takeAnimation(int index) |
| virtual bool | event(QEvent * event) |
TheQAnimationGroup class is an abstract base class for groups of animations.
An animation group is a container for animations (subclasses ofQAbstractAnimation). A group is usually responsible for managing thestate of its animations, i.e., it decides when to start, stop, resume, and pause them. Currently, Qt provides two such groups:QParallelAnimationGroup andQSequentialAnimationGroup. Look up their class descriptions for details.
SinceQAnimationGroup inherits fromQAbstractAnimation, you can combine groups, and easily construct complex animation graphs. You can queryQAbstractAnimation for the group it belongs to (using thegroup() function).
To start a top-level animation group, you simply use thestart() function fromQAbstractAnimation. By a top-level animation group, we think of a group that itself is not contained within another group. Starting sub groups directly is not supported, and may lead to unexpected behavior.
QAnimationGroup provides methods for adding and retrieving animations. Besides that, you can remove animations by calling remove(), and clear the animation group by callingclear(). You may keep track of changes in the group's animations by listening toQEvent::ChildAdded andQEvent::ChildRemoved events.
QAnimationGroup takes ownership of the animations it manages, and ensures that they are deleted when the animation group is deleted.
See alsoQAbstractAnimation,QVariantAnimation, andThe Animation Framework.
Constructs aQAnimationGroup.parent is passed toQObject's constructor.
Destroys the animation group. It will also destroy all its animations.
Addsanimation to this group. This will callinsertAnimation with index equals toanimationCount().
Note:The group takes ownership of the animation.
See alsoremoveAnimation().
Returns a pointer to the animation atindex in this group. This function is useful when you need access to a particular animation.index is between 0 andanimationCount() - 1.
See alsoanimationCount() andindexOfAnimation().
Returns the number of animations managed by this group.
See alsoindexOfAnimation(),addAnimation(), andanimationAt().
Removes and deletes all animations in this animation group, and resets the current time to 0.
See alsoaddAnimation() andremoveAnimation().
[virtual protected]bool QAnimationGroup::event(QEvent * event)Reimplemented fromQObject::event().
Returns the index ofanimation. The returned index can be passed to the other functions that take an index as an argument.
See alsoinsertAnimation(),animationAt(), andtakeAnimation().
Insertsanimation into this animation group atindex. Ifindex is 0 the animation is inserted at the beginning. Ifindex isanimationCount(), the animation is inserted at the end.
Note:The group takes ownership of the animation.
See alsotakeAnimation(),addAnimation(),indexOfAnimation(), andremoveAnimation().
Removesanimation from this group. The ownership ofanimation is transferred to the caller.
See alsotakeAnimation(),insertAnimation(), andaddAnimation().
Returns the animation atindex and removes it from the animation group.
Note:The ownership of the animation is transferred to the caller.
See alsoremoveAnimation(),addAnimation(),insertAnimation(), andindexOfAnimation().
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.