QtBase
v6.3.1
|
The QPauseAnimation class provides a pause for QSequentialAnimationGroup. More...
#include <qpauseanimation.h>
Protected Member Functions | |
bool | event (QEvent *e) override |
void | updateCurrentTime (int) override |
Protected Member Functions inherited from QAbstractAnimation | |
QAbstractAnimation (QAbstractAnimationPrivate &dd, QObject *parent=nullptr) | |
virtual void | updateState (QAbstractAnimation::State newState, QAbstractAnimation::State oldState) |
virtual void | updateDirection (QAbstractAnimation::Direction direction) |
Protected Member Functions inherited from QObject | |
QObject * | sender () const |
int | senderSignalIndex () const |
int | receivers (const char *signal) const |
bool | isSignalConnected (const QMetaMethod &signal) const |
virtual void | timerEvent (QTimerEvent *event) |
virtual void | childEvent (QChildEvent *event) |
virtual void | customEvent (QEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
QObject (QObjectPrivate &dd, QObject *parent=nullptr) | |
Properties | |
int | duration |
the duration of the pause. More... | |
Properties inherited from QAbstractAnimation | |
State | state |
state of the animation. More... | |
int | loopCount |
the loop count of the animation More... | |
int | currentTime |
the current time and progress of the animation More... | |
int | currentLoop |
the current loop of the animation More... | |
Direction | direction |
the direction of the animation when it is in \l Running state. More... | |
int | duration |
the duration of the animation. More... | |
Properties inherited from QObject | |
QString | objectName |
the name of this object More... | |
The QPauseAnimation class provides a pause for QSequentialAnimationGroup.
\inmodule QtCore
If you wish to introduce a delay between animations in a QSequentialAnimationGroup, you can insert a QPauseAnimation. This class does not animate anything, but does not \l{QAbstractAnimation::finished()}{finish} before a specified number of milliseconds have elapsed from when it was started. You specify the duration of the pause in the constructor. It can also be set directly with setDuration().
It is not necessary to construct a QPauseAnimation yourself. QSequentialAnimationGroup provides the convenience functions \l{QSequentialAnimationGroup::}{addPause()} and \l{QSequentialAnimationGroup::}{insertPause()}. These functions simply take the number of milliseconds the pause should last.
Definition at line 51 of file qpauseanimation.h.
Constructs a QPauseAnimation. parent is passed to QObject's constructor. The default duration is 0.
Definition at line 90 of file qpauseanimation.cpp.
Constructs a QPauseAnimation. msecs is the duration of the pause. parent is passed to QObject's constructor.
Definition at line 100 of file qpauseanimation.cpp.
QPauseAnimation::~QPauseAnimation | ( | ) |
Destroys the pause animation.
Definition at line 108 of file qpauseanimation.cpp.
QBindable< int > QPauseAnimation::bindableDuration | ( | ) |
Definition at line 141 of file qpauseanimation.cpp.
|
overridevirtual |
This pure virtual function returns the duration of the animation, and defines for how long QAbstractAnimation should update the current time. This duration is local, and does not include the loop count.
A return value of -1 indicates that the animation has no defined duration; the animation should run forever until stopped. This is useful for animations that are not time driven, or where you cannot easily predict its duration (e.g., event driven audio playback in a game).
If the animation is a parallel QAnimationGroup, the duration will be the longest duration of all its animations. If the animation is a sequential QAnimationGroup, the duration will be the sum of the duration of all its animations.
Implements QAbstractAnimation.
Definition at line 119 of file qpauseanimation.cpp.
|
overrideprotectedvirtual |
\reimp
Reimplemented from QAbstractAnimation.
Definition at line 150 of file qpauseanimation.cpp.
void QPauseAnimation::setDuration | ( | int | msecs | ) |
|
overrideprotectedvirtual |
\reimp
Implements QAbstractAnimation.
Reimplemented in TestablePauseAnimation.
Definition at line 158 of file qpauseanimation.cpp.
|
readwrite |
the duration of the pause.
The duration of the pause. The duration should not be negative. The default duration is 250 milliseconds.
Definition at line 73 of file qpauseanimation.h.