QSequentialAnimationGroup 类

QSequentialAnimationGroup 类提供一组连续动画。 更多...

头: #include <QSequentialAnimationGroup>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
继承: QAnimationGroup

特性

公共函数

QSequentialAnimationGroup (QObject * parent = nullptr)
virtual ~QSequentialAnimationGroup ()
QPauseAnimation * addPause (int msecs )
QBindable<QAbstractAnimation *> bindableCurrentAnimation () const
QAbstractAnimation * currentAnimation () const
QPauseAnimation * insertPause (int index , int msecs )

重实现公共函数

virtual int duration () const override

信号

void currentAnimationChanged (QAbstractAnimation * current )

重实现保护函数

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

详细描述

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 () 或 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 () 或 insertPause () to add a pause to a sequential animation group.

    QSequentialAnimationGroup *group = new QSequentialAnimationGroup;
    group->addAnimation(anim1);
    group->addAnimation(anim2);
    group->start();
					

在此范例中, anim1 and anim2 are two already set up QPropertyAnimation

另请参阅 QAnimationGroup , QAbstractAnimation ,和 动画框架 .

特性文档编制

[bindable read-only] currentAnimation : QAbstractAnimation *

注意: 此特性支持 QProperty 绑定。

This property holds the animation in the current time.

成员函数文档编制

QSequentialAnimationGroup:: QSequentialAnimationGroup ( QObject * parent = nullptr)

Constructs a QSequentialAnimationGroup. parent 会被传递给 QObject 的构造函数。

[虚拟] 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.

另请参阅 insertPause () 和 QAnimationGroup::addAnimation ().

[signal] void QSequentialAnimationGroup:: currentAnimationChanged ( QAbstractAnimation * current )

QSequentialAnimationGroup emits this signal when currentAnimation 已改变。 current is the current animation.

注意: 通知程序信号对于特性 currentAnimation .

另请参阅 currentAnimation ().

[override virtual] int QSequentialAnimationGroup:: duration () const

重实现: QAbstractAnimation::duration() const .

[override virtual protected] bool QSequentialAnimationGroup:: event ( QEvent * event )

重实现: QAnimationGroup::event (QEvent *event).

QPauseAnimation *QSequentialAnimationGroup:: insertPause ( int index , int msecs )

Inserts a pause of msecs milliseconds at index in this animation group.

另请参阅 addPause () 和 QAnimationGroup::insertAnimation ().

[override virtual protected] void QSequentialAnimationGroup:: updateCurrentTime ( int currentTime )

重实现: QAbstractAnimation::updateCurrentTime (int currentTime).

[override virtual protected] void QSequentialAnimationGroup:: updateDirection ( QAbstractAnimation::Direction direction )

重实现: QAbstractAnimation::updateDirection (QAbstractAnimation::Direction direction).

[override virtual protected] void QSequentialAnimationGroup:: updateState ( QAbstractAnimation::State newState , QAbstractAnimation::State oldState )

重实现: QAbstractAnimation::updateState (QAbstractAnimation::State newState, QAbstractAnimation::State oldState).