QAnimationGroup Class Reference
[QtCore module]
该QAnimationGroup类是动画组的抽象基类。More…
通过继承QParallelAnimationGroup和QSequentialAnimationGroup。
Methods
__init__ (self, QObject parent = None)
addAnimation (self, QAbstractAnimation animation)
QAbstractAnimation animationAt (self, int index)
int animationCount (self)
clear (self)
bool event (self, QEvent event)
int indexOfAnimation (self, QAbstractAnimation animation)
insertAnimation (self, int index, QAbstractAnimation animation)
removeAnimation (self, QAbstractAnimation animation)
QAbstractAnimation takeAnimation (self, int index)
Detailed Description
该QAnimationGroup类是动画组的抽象基类。
动画组是一个容器的子类的动画(QAbstractAnimation) 。一组通常是负责管理state它的动画,也就是说,它决定何时启动,停止,恢复和暂停它们。目前, Qt提供了两个这样的组:QParallelAnimationGroup和QSequentialAnimationGroup。查一查他们的类的描述了解详情。
由于QAnimationGroup从继承QAbstractAnimation,你可以结合组和轻松构建复杂的动画图形。您可以查询QAbstractAnimation该组属于(使用group()功能)。
要启动一个顶级的动画组,您只需使用start()从功能QAbstractAnimation。由顶级的动画组,我们认为本身不包含在另一组一组。直接不支持启动子组,并可能导致意外的行为。
QAnimationGroup提供用于添加和检索的动画。除此之外,你可以通过调用remove (删除动画) ,并清除动画组通过调用clear( ) 。你可以通过听,保持变化组的动画轨迹QEvent.ChildAdded和QEvent.ChildRemoved事件。
QAnimationGroup需要它管理的动画的所有权,并确保当动画组将被删除,他们都将被删除。
Method Documentation
QAnimationGroup.__init__ (self, QObject parent = None)
该parent的说法,如果不是没有,原因self通过Qt的,而不是PyQt的拥有。
构造一个QAnimationGroup。parent被传递给QObject的构造。
QAnimationGroup.addAnimation (self, QAbstractAnimation animation)
该animation说法有它的所有权转移给Qt的。
添加animation这一组。这将调用insertAnimation与指数等于animationCount( ) 。
Note:该小组采用了动画的所有权。
See also removeAnimation( ) 。
QAbstractAnimation QAnimationGroup.animationAt (self, int index)
返回一个指针,指向在动画index在这一组。当你需要访问一个特定的动画,此功能非常有用。index是介于0和animationCount( ) - 1 。
See also animationCount()和indexOfAnimation( ) 。
int QAnimationGroup.animationCount (self)
返回该组管理动画的数量。
See also indexOfAnimation( )addAnimation()和animationAt( ) 。
QAnimationGroup.clear (self)
删除,并删除所有的动画在这个动画组,和当前时间重置为0 。
See also addAnimation()和removeAnimation( ) 。
bool QAnimationGroup.event (self, QEvent event)
从重新实现QObject.event( ) 。
int QAnimationGroup.indexOfAnimation (self, QAbstractAnimation animation)
返回的索引animation。返回的索引可以传递给其他函数接受一个索引作为参数。
See also insertAnimation( )animationAt()和takeAnimation( ) 。
QAnimationGroup.insertAnimation (self, int index, QAbstractAnimation animation)
该animation说法有它的所有权转移给Qt的。
Inserts animation这个动画组index。如果index为0的动画被插在开头。如果index is animationCount() ,该动画被插入在末端。
Note:该小组采用了动画的所有权。
See also takeAnimation( )addAnimation( )indexOfAnimation()和removeAnimation( ) 。
QAnimationGroup.removeAnimation (self, QAbstractAnimation animation)
该animation争论
移除animation从本组。所有权animation传送到呼叫者。
See also takeAnimation( )insertAnimation()和addAnimation( ) 。
QAbstractAnimation QAnimationGroup.takeAnimation (self, int index)
[
该QAbstractAnimation结果
返回在动画index从动画组中删除。
Note:动画的所有权转移给调用者。
]($docs-qabstractanimation.html)
See also removeAnimation( )addAnimation( )insertAnimation()和indexOfAnimation( ) 。