PySide6.QtCore.QAnimationGroup¶
- class QAnimationGroup¶
- The - QAnimationGroupclass is an abstract base class for groups of animations. More…- Inherited by: - QSequentialAnimationGroup,- QParallelAnimationGroup- Added in version 4.6. - Synopsis¶- Methods¶- def - __init__()
- def - addAnimation()
- def - animationAt()
- def - animationCount()
- def - clear()
- def - takeAnimation()
 - Note - This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE - Detailed Description¶- An animation group is a container for animations (subclasses of - QAbstractAnimation). A group is usually responsible for managing the- stateof its animations, i.e., it decides when to start, stop, resume, and pause them. Currently, Qt provides two such groups:- QParallelAnimationGroupand- QSequentialAnimationGroup. Look up their class descriptions for details.- Since - QAnimationGroupinherits from- QAbstractAnimation, you can combine groups, and easily construct complex animation graphs. You can query- QAbstractAnimationfor the group it belongs to (using the- group()function).- To start a top-level animation group, you simply use the - start()function from- QAbstractAnimation. 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.- QAnimationGroupprovides methods for adding and retrieving animations. Besides that, you can remove animations by calling- removeAnimation(), and clear the animation group by calling- clear(). You may keep track of changes in the group’s animations by listening to- ChildAddedand- ChildRemovedevents.- QAnimationGrouptakes ownership of the animations it manages, and ensures that they are deleted when the animation group is deleted.- Constructs a - QAnimationGroup.- parentis passed to- QObject‘s constructor.- addAnimation(animation)¶
- Parameters:
- animation – - QAbstractAnimation
 
 - Adds - animationto this group. This will call- insertAnimationwith index equals to- animationCount().- animationAt(index)¶
- Parameters:
- index – int 
- Return type:
 
 - Returns a pointer to the animation at - indexin this group. This function is useful when you need access to a particular animation.- indexis between 0 and- animationCount()- 1.- See also - animationCount()¶
- Return type:
- int 
 
 - Returns the number of animations managed by this group. - clear()¶
 - Removes and deletes all animations in this animation group, and resets the current time to 0. - See also - indexOfAnimation(animation)¶
- Parameters:
- animation – - QAbstractAnimation
- Return type:
- int 
 
 - Returns the index of - animation. The returned index can be passed to the other functions that take an index as an argument.- insertAnimation(index, animation)¶
- Parameters:
- index – int 
- animation – - QAbstractAnimation
 
 
 - Inserts - animationinto this animation group at- index. If- indexis 0 the animation is inserted at the beginning. If- indexis- animationCount(), the animation is inserted at the end.- Note - The group takes ownership of the animation. - removeAnimation(animation)¶
- Parameters:
- animation – - QAbstractAnimation
 
 - Removes - animationfrom this group. The ownership of- animationis transferred to the caller.- takeAnimation(index)¶
- Parameters:
- index – int 
- Return type:
 
 - Returns the animation at - indexand removes it from the animation group.- Note - The ownership of the animation is transferred to the caller.