• PySide 模块
  • PySide.QtCore
  • 内容表

    上一话题

    QPauseAnimation

    下一话题

    QSequentialAnimationGroup

    QAnimationGroup

    继承者: QSequentialAnimationGroup , QParallelAnimationGroup

    注意

    该类在 Qt4.6 引入

    概要

    函数

    详细描述

    PySide.QtCore.QAnimationGroup class is an abstract base class for groups of animations.

    An animation group is a container for animations (subclasses of PySide.QtCore.QAbstractAnimation ). A group is usually responsible for managing the state of its animations, i.e., it decides when to start, stop, resume, and pause them. Currently, Qt provides two such groups: PySide.QtCore.QParallelAnimationGroup and PySide.QtCore.QSequentialAnimationGroup . Look up their class descriptions for details.

    Since PySide.QtCore.QAnimationGroup 继承自 PySide.QtCore.QAbstractAnimation , you can combine groups, and easily construct complex animation graphs. You can query PySide.QtCore.QAbstractAnimation for the group it belongs to (using the PySide.QtCore.QAbstractAnimation.group() 函数)。

    To start a top-level animation group, you simply use the PySide.QtCore.QAbstractAnimation.start() function from PySide.QtCore.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.

    PySide.QtCore.QAnimationGroup provides methods for adding and retrieving animations. Besides that, you can remove animations by calling remove() , and clear the animation group by calling PySide.QtCore.QAnimationGroup.clear() . You may keep track of changes in the group's animations by listening to QEvent.ChildAdded and QEvent.ChildRemoved 事件。

    PySide.QtCore.QAnimationGroup takes ownership of the animations it manages, and ensures that they are deleted when the animation group is deleted.

    class PySide.QtCore. QAnimationGroup ( [ parent=None ] )
    参数: parent PySide.QtCore.QObject

    构造 PySide.QtCore.QAnimationGroup . parent 会被传递给 PySide.QtCore.QObject ‘s constructor.

    PySide.QtCore.QAnimationGroup. addAnimation ( animation )
    参数: animation PySide.QtCore.QAbstractAnimation

    添加 animation to this group. This will call insertAnimation with index equals to PySide.QtCore.QAnimationGroup.animationCount() .

    注意

    The group takes ownership of the animation.

    PySide.QtCore.QAnimationGroup. animationAt ( index )
    参数: index PySide.QtCore.int
    返回类型: PySide.QtCore.QAbstractAnimation

    Returns a pointer to the animation at index in this group. This function is useful when you need access to a particular animation. index is between 0 and PySide.QtCore.QAnimationGroup.animationCount() - 1.

    PySide.QtCore.QAnimationGroup. animationCount ( )
    返回类型: PySide.QtCore.int

    Returns the number of animations managed by this group.

    PySide.QtCore.QAnimationGroup. clear ( )

    Removes and deletes all animations in this animation group, and resets the current time to 0.

    PySide.QtCore.QAnimationGroup. indexOfAnimation ( animation )
    参数: animation PySide.QtCore.QAbstractAnimation
    返回类型: PySide.QtCore.int

    Returns the index of animation . The returned index can be passed to the other functions that take an index as an argument.

    PySide.QtCore.QAnimationGroup. insertAnimation ( index , animation )
    参数:

    插入 animation into this animation group at index 。若 index is 0 the animation is inserted at the beginning. If index is PySide.QtCore.QAnimationGroup.animationCount() , the animation is inserted at the end.

    注意

    The group takes ownership of the animation.

    PySide.QtCore.QAnimationGroup. removeAnimation ( animation )
    参数: animation PySide.QtCore.QAbstractAnimation

    移除 animation from this group. The ownership of animation is transferred to the caller.

    PySide.QtCore.QAnimationGroup. takeAnimation ( index )
    参数: index PySide.QtCore.int
    返回类型: PySide.QtCore.QAbstractAnimation

    Returns the animation at index and removes it from the animation group.

    注意

    The ownership of the animation is transferred to the caller.