QSequentialAnimationGroup 類提供一組連續動畫。 更多...
| 頭: | #include <QSequentialAnimationGroup> |
| qmake: | QT += core |
| Since: | Qt 4.6 |
| 繼承: | QAnimationGroup |
該類在 Qt 4.6 引入。
| QSequentialAnimationGroup (QObject * parent = nullptr) | |
| virtual | ~QSequentialAnimationGroup () |
| QPauseAnimation * | addPause (int msecs ) |
| 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() or 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 ,和 動畫框架 .
Returns the animation in the current time.
訪問函數:
| QAbstractAnimation * | currentAnimation () const |
通知程序信號:
| void | currentAnimationChanged (QAbstractAnimation * current ) |
Constructs a QSequentialAnimationGroup. parent 被傳遞給 QObject 的構造函數。
[signal]
void
QSequentialAnimationGroup::
currentAnimationChanged
(
QAbstractAnimation
*
current
)
QSequentialAnimationGroup emits this signal when currentAnimation 已改變。 current is the current animation.
注意: 通知程序信號對於特性 currentAnimation .
另請參閱 currentAnimation ().
[虛擬]
QSequentialAnimationGroup::
~QSequentialAnimationGroup
()
Destroys the animation group. It will also destroy all its animations.
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 ().
[override virtual]
int
QSequentialAnimationGroup::
duration
() const
重實現: QAbstractAnimation::duration () const.
[override virtual protected]
bool
QSequentialAnimationGroup::
event
(
QEvent
*
event
)
重實現: QAnimationGroup::event (QEvent *event).
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).