summaryrefslogtreecommitdiffstats
path: root/src/corelib/animation
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/animation')
-rw-r--r--src/corelib/animation/qabstractanimation.cpp105
-rw-r--r--src/corelib/animation/qabstractanimation.h10
-rw-r--r--src/corelib/animation/qabstractanimation_p.h4
-rw-r--r--src/corelib/animation/qanimationgroup.cpp28
-rw-r--r--src/corelib/animation/qanimationgroup.h6
-rw-r--r--src/corelib/animation/qparallelanimationgroup.cpp6
-rw-r--r--src/corelib/animation/qparallelanimationgroup.h2
-rw-r--r--src/corelib/animation/qpauseanimation.cpp2
-rw-r--r--src/corelib/animation/qpropertyanimation.cpp6
-rw-r--r--src/corelib/animation/qpropertyanimation.h2
-rw-r--r--src/corelib/animation/qsequentialanimationgroup.cpp22
-rw-r--r--src/corelib/animation/qsequentialanimationgroup.h4
-rw-r--r--src/corelib/animation/qvariantanimation.cpp4
-rw-r--r--src/corelib/animation/qvariantanimation.h2
14 files changed, 117 insertions, 86 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index a4c7e299ef..be99b3b226 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -50,7 +50,7 @@
animations that plug into the rest of the animation framework.
The progress of an animation is given by its current time
- (currentTime()), which is measured in milliseconds from the start
+ (currentLoopTime()), which is measured in milliseconds from the start
of the animation (0) to its end (duration()). The value is updated
automatically while the animation is running. It can also be set
directly with setCurrentTime().
@@ -115,7 +115,7 @@
*/
/*!
- \fn QAbstractAnimation::stateChanged(QAbstractAnimation::State oldState, QAbstractAnimation::State newState)
+ \fn QAbstractAnimation::stateChanged(QAbstractAnimation::State newState, QAbstractAnimation::State oldState)
QAbstractAnimation emits this signal whenever the state of the animation has
changed from \a oldState to \a newState. This signal is emitted after the virtual
@@ -165,8 +165,8 @@ Q_GLOBAL_STATIC(QThreadStorage<QUnifiedTimer *>, unifiedTimer)
QUnifiedTimer::QUnifiedTimer() :
QObject(), lastTick(0), timingInterval(DEFAULT_TIMER_INTERVAL),
- currentAnimationIdx(0), consistentTiming(false), isPauseTimerActive(false),
- runningLeafAnimations(0)
+ currentAnimationIdx(0), consistentTiming(false), slowMode(false),
+ isPauseTimerActive(false), runningLeafAnimations(0)
{
}
@@ -191,8 +191,10 @@ void QUnifiedTimer::ensureTimerUpdate()
void QUnifiedTimer::updateAnimationsTime()
{
// ignore consistentTiming in case the pause timer is active
- const int delta = (consistentTiming && !isPauseTimerActive) ?
+ int delta = (consistentTiming && !isPauseTimerActive) ?
timingInterval : time.elapsed() - lastTick;
+ if (slowMode)
+ delta /= 5;
lastTick = time.elapsed();
//we make sure we only call update time if the time has actually changed
@@ -213,6 +215,10 @@ void QUnifiedTimer::restartAnimationTimer()
{
if (runningLeafAnimations == 0 && !runningPauseAnimations.isEmpty()) {
int closestTimeToFinish = closestPauseAnimationTimeToFinish();
+ if (closestTimeToFinish < 0) {
+ qDebug() << runningPauseAnimations;
+ qDebug() << closestPauseAnimationTimeToFinish();
+ }
animationTimer.start(closestTimeToFinish, this);
isPauseTimerActive = true;
} else if (!animationTimer.isActive() || isPauseTimerActive) {
@@ -287,9 +293,11 @@ void QUnifiedTimer::registerRunningAnimation(QAbstractAnimation *animation)
if (QAbstractAnimationPrivate::get(animation)->isGroup)
return;
- if (QAbstractAnimationPrivate::get(animation)->isPause)
+ if (QAbstractAnimationPrivate::get(animation)->isPause) {
+ if (animation->duration() == -1)
+ qDebug() << "toto";
runningPauseAnimations << animation;
- else
+ } else
runningLeafAnimations++;
}
@@ -313,9 +321,9 @@ int QUnifiedTimer::closestPauseAnimationTimeToFinish()
int timeToFinish;
if (animation->direction() == QAbstractAnimation::Forward)
- timeToFinish = animation->duration() - animation->currentTime();
+ timeToFinish = animation->duration() - animation->currentLoopTime();
else
- timeToFinish = animation->currentTime();
+ timeToFinish = animation->currentLoopTime();
if (timeToFinish < closestTimeToFinish)
closestTimeToFinish = timeToFinish;
@@ -347,34 +355,32 @@ void QAbstractAnimationPrivate::setState(QAbstractAnimation::State newState)
state = newState;
QWeakPointer<QAbstractAnimation> guard(q);
- q->updateState(oldState, newState);
- if (!guard)
- return;
+ //(un)registration of the animation must always happen before calls to
+ //virtual function (updateState) to ensure a correct state of the timer
+ bool isTopLevel = !group || group->state() == QAbstractAnimation::Stopped;
+ if (oldState == QAbstractAnimation::Running) {
+ if (newState == QAbstractAnimation::Paused && hasRegisteredTimer)
+ QUnifiedTimer::instance()->ensureTimerUpdate();
+ //the animation, is not running any more
+ QUnifiedTimer::instance()->unregisterAnimation(q);
+ } else if (newState == QAbstractAnimation::Running) {
+ QUnifiedTimer::instance()->registerAnimation(q, isTopLevel);
+ }
- //this is to be safe if updateState changes the state
- if (state == oldState)
+ q->updateState(newState, oldState);
+ if (!guard || newState != state) //this is to be safe if updateState changes the state
return;
// Notify state change
- emit q->stateChanged(oldState, newState);
- if (!guard)
+ emit q->stateChanged(newState, oldState);
+ if (!guard || newState != state) //this is to be safe if updateState changes the state
return;
switch (state) {
case QAbstractAnimation::Paused:
- if (hasRegisteredTimer)
- // currentTime needs to be updated if pauseTimer is active
- QUnifiedTimer::instance()->ensureTimerUpdate();
- if (!guard)
- return;
- //here we're sure that we were in running state before and that the
- //animation is currently registered
- QUnifiedTimer::instance()->unregisterAnimation(q);
break;
case QAbstractAnimation::Running:
{
- bool isTopLevel = !group || group->state() == QAbstractAnimation::Stopped;
- QUnifiedTimer::instance()->registerAnimation(q, isTopLevel);
// this ensures that the value is updated now that the animation is running
if (oldState == QAbstractAnimation::Stopped) {
@@ -389,15 +395,10 @@ void QAbstractAnimationPrivate::setState(QAbstractAnimation::State newState)
case QAbstractAnimation::Stopped:
// Leave running state.
int dura = q->duration();
- if (!guard)
- return;
if (deleteWhenStopped)
q->deleteLater();
- if (oldState == QAbstractAnimation::Running)
- QUnifiedTimer::instance()->unregisterAnimation(q);
-
if (dura == -1 || loopCount < 0
|| (oldDirection == QAbstractAnimation::Forward && (oldCurrentTime * (oldCurrentLoop + 1)) == (dura * loopCount))
|| (oldDirection == QAbstractAnimation::Backward && oldCurrentTime == 0)) {
@@ -642,6 +643,18 @@ int QAbstractAnimation::totalDuration() const
}
/*!
+ Returns the current time inside the current loop. It can go from 0 to duration().
+
+ \sa duration(), currentTime
+*/
+
+int QAbstractAnimation::currentLoopTime() const
+{
+ Q_D(const QAbstractAnimation);
+ return d->currentTime;
+}
+
+/*!
\property QAbstractAnimation::currentTime
\brief the current time and progress of the animation
@@ -650,17 +663,14 @@ int QAbstractAnimation::totalDuration() const
the animation run, setting the current time automatically as the animation
progresses.
- The animation's current time starts at 0, and ends at duration(). If the
- animation's loopCount is larger than 1, the current time will rewind and
- start at 0 again for the consecutive loops. If the animation has a pause.
- currentTime will also include the duration of the pause.
+ The animation's current time starts at 0, and ends at totalDuration().
- \sa loopCount
+ \sa loopCount, currentLoopTime
*/
int QAbstractAnimation::currentTime() const
{
Q_D(const QAbstractAnimation);
- return d->currentTime;
+ return d->totalCurrentTime;
}
void QAbstractAnimation::setCurrentTime(int msecs)
{
@@ -734,7 +744,7 @@ void QAbstractAnimation::start(DeletionPolicy policy)
signal, and state() returns Stopped. The current time is not changed.
If the animation stops by itself after reaching the end (i.e.,
- currentTime() == duration() and currentLoop() > loopCount() - 1), the
+ currentLoopTime() == duration() and currentLoop() > loopCount() - 1), the
finished() signal is emitted.
\sa start(), state()
@@ -784,6 +794,21 @@ void QAbstractAnimation::resume()
}
/*!
+ If \a paused is true, the animation is paused.
+ If \a paused is false, the animation is resumed.
+
+ \sa state(), pause(), resume()
+*/
+void QAbstractAnimation::setPaused(bool paused)
+{
+ if (paused)
+ pause();
+ else
+ resume();
+}
+
+
+/*!
\reimp
*/
bool QAbstractAnimation::event(QEvent *event)
@@ -806,8 +831,8 @@ bool QAbstractAnimation::event(QEvent *event)
\sa start(), stop(), pause(), resume()
*/
-void QAbstractAnimation::updateState(QAbstractAnimation::State oldState,
- QAbstractAnimation::State newState)
+void QAbstractAnimation::updateState(QAbstractAnimation::State newState,
+ QAbstractAnimation::State oldState)
{
Q_UNUSED(oldState);
Q_UNUSED(newState);
diff --git a/src/corelib/animation/qabstractanimation.h b/src/corelib/animation/qabstractanimation.h
index 3d608b64dc..3c6e12fab6 100644
--- a/src/corelib/animation/qabstractanimation.h
+++ b/src/corelib/animation/qabstractanimation.h
@@ -95,6 +95,9 @@ public:
Direction direction() const;
void setDirection(Direction direction);
+ int currentTime() const;
+ int currentLoopTime() const;
+
int loopCount() const;
void setLoopCount(int loopCount);
int currentLoop() const;
@@ -102,11 +105,9 @@ public:
virtual int duration() const = 0;
int totalDuration() const;
- int currentTime() const;
-
Q_SIGNALS:
void finished();
- void stateChanged(QAbstractAnimation::State oldState, QAbstractAnimation::State newState);
+ void stateChanged(QAbstractAnimation::State newState, QAbstractAnimation::State oldState);
void currentLoopChanged(int currentLoop);
void directionChanged(QAbstractAnimation::Direction);
@@ -114,6 +115,7 @@ public Q_SLOTS:
void start(QAbstractAnimation::DeletionPolicy policy = KeepWhenStopped);
void pause();
void resume();
+ void setPaused(bool);
void stop();
void setCurrentTime(int msecs);
@@ -122,7 +124,7 @@ protected:
bool event(QEvent *event);
virtual void updateCurrentTime(int currentTime) = 0;
- virtual void updateState(QAbstractAnimation::State oldState, QAbstractAnimation::State newState);
+ virtual void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState);
virtual void updateDirection(QAbstractAnimation::Direction direction);
private:
diff --git a/src/corelib/animation/qabstractanimation_p.h b/src/corelib/animation/qabstractanimation_p.h
index f989bce269..720e68d193 100644
--- a/src/corelib/animation/qabstractanimation_p.h
+++ b/src/corelib/animation/qabstractanimation_p.h
@@ -138,6 +138,9 @@ public:
*/
void setConsistentTiming(bool consistent) { consistentTiming = consistent; }
+ //this facilitates fine-tuning of complex animations
+ void setSlowModeEnabled(bool enabled) { slowMode = enabled; }
+
/*
this is used for updating the currentTime of all animations in case the pause
timer is active or, otherwise, only of the animation passed as parameter.
@@ -164,6 +167,7 @@ private:
int timingInterval;
int currentAnimationIdx;
bool consistentTiming;
+ bool slowMode;
// bool to indicate that only pause animations are active
bool isPauseTimerActive;
diff --git a/src/corelib/animation/qanimationgroup.cpp b/src/corelib/animation/qanimationgroup.cpp
index 40f5936554..64282eab5f 100644
--- a/src/corelib/animation/qanimationgroup.cpp
+++ b/src/corelib/animation/qanimationgroup.cpp
@@ -70,7 +70,7 @@
QAnimationGroup provides methods for adding and retrieving
animations. Besides that, you can remove animations by calling
remove(), and clear the animation group by calling
- clearAnimations(). You may keep track of changes in the group's
+ clear(). You may keep track of changes in the group's
animations by listening to QEvent::ChildAdded and
QEvent::ChildRemoved events.
@@ -151,7 +151,7 @@ int QAnimationGroup::animationCount() const
Returns the index of \a animation. The returned index can be passed
to the other functions that take an index as an argument.
- \sa insertAnimationAt(), animationAt(), takeAnimationAt()
+ \sa insertAnimation(), animationAt(), takeAnimation()
*/
int QAnimationGroup::indexOfAnimation(QAbstractAnimation *animation) const
{
@@ -160,7 +160,7 @@ int QAnimationGroup::indexOfAnimation(QAbstractAnimation *animation) const
}
/*!
- Adds \a animation to this group. This will call insertAnimationAt with
+ Adds \a animation to this group. This will call insertAnimation with
index equals to animationCount().
\note The group takes ownership of the animation.
@@ -170,7 +170,7 @@ int QAnimationGroup::indexOfAnimation(QAbstractAnimation *animation) const
void QAnimationGroup::addAnimation(QAbstractAnimation *animation)
{
Q_D(QAnimationGroup);
- insertAnimationAt(d->animations.count(), animation);
+ insertAnimation(d->animations.count(), animation);
}
/*!
@@ -180,14 +180,14 @@ void QAnimationGroup::addAnimation(QAbstractAnimation *animation)
\note The group takes ownership of the animation.
- \sa takeAnimationAt(), addAnimation(), indexOfAnimation(), removeAnimation()
+ \sa takeAnimation(), addAnimation(), indexOfAnimation(), removeAnimation()
*/
-void QAnimationGroup::insertAnimationAt(int index, QAbstractAnimation *animation)
+void QAnimationGroup::insertAnimation(int index, QAbstractAnimation *animation)
{
Q_D(QAnimationGroup);
if (index < 0 || index > d->animations.size()) {
- qWarning("QAnimationGroup::insertAnimationAt: index is out of bounds");
+ qWarning("QAnimationGroup::insertAnimation: index is out of bounds");
return;
}
@@ -205,7 +205,7 @@ void QAnimationGroup::insertAnimationAt(int index, QAbstractAnimation *animation
Removes \a animation from this group. The ownership of \a animation is
transferred to the caller.
- \sa takeAnimationAt(), insertAnimationAt(), addAnimation()
+ \sa takeAnimation(), insertAnimation(), addAnimation()
*/
void QAnimationGroup::removeAnimation(QAbstractAnimation *animation)
{
@@ -221,7 +221,7 @@ void QAnimationGroup::removeAnimation(QAbstractAnimation *animation)
return;
}
- takeAnimationAt(index);
+ takeAnimation(index);
}
/*!
@@ -229,13 +229,13 @@ void QAnimationGroup::removeAnimation(QAbstractAnimation *animation)
\note The ownership of the animation is transferred to the caller.
- \sa removeAnimation(), addAnimation(), insertAnimationAt(), indexOfAnimation()
+ \sa removeAnimation(), addAnimation(), insertAnimation(), indexOfAnimation()
*/
-QAbstractAnimation *QAnimationGroup::takeAnimationAt(int index)
+QAbstractAnimation *QAnimationGroup::takeAnimation(int index)
{
Q_D(QAnimationGroup);
if (index < 0 || index >= d->animations.size()) {
- qWarning("QAnimationGroup::takeAnimationAt: no animation at index %d", index);
+ qWarning("QAnimationGroup::takeAnimation: no animation at index %d", index);
return 0;
}
QAbstractAnimation *animation = d->animations.at(index);
@@ -254,7 +254,7 @@ QAbstractAnimation *QAnimationGroup::takeAnimationAt(int index)
\sa addAnimation(), removeAnimation()
*/
-void QAnimationGroup::clearAnimations()
+void QAnimationGroup::clear()
{
Q_D(QAnimationGroup);
qDeleteAll(d->animations);
@@ -279,7 +279,7 @@ bool QAnimationGroup::event(QEvent *event)
// case it might be called from the destructor.
int index = d->animations.indexOf(a);
if (index != -1)
- takeAnimationAt(index);
+ takeAnimation(index);
}
return QAbstractAnimation::event(event);
}
diff --git a/src/corelib/animation/qanimationgroup.h b/src/corelib/animation/qanimationgroup.h
index 86368a33b4..416ce3fb47 100644
--- a/src/corelib/animation/qanimationgroup.h
+++ b/src/corelib/animation/qanimationgroup.h
@@ -65,10 +65,10 @@ public:
int animationCount() const;
int indexOfAnimation(QAbstractAnimation *animation) const;
void addAnimation(QAbstractAnimation *animation);
- void insertAnimationAt(int index, QAbstractAnimation *animation);
+ void insertAnimation(int index, QAbstractAnimation *animation);
void removeAnimation(QAbstractAnimation *animation);
- QAbstractAnimation *takeAnimationAt(int index);
- void clearAnimations();
+ QAbstractAnimation *takeAnimation(int index);
+ void clear();
protected:
QAnimationGroup(QAnimationGroupPrivate &dd, QObject *parent);
diff --git a/src/corelib/animation/qparallelanimationgroup.cpp b/src/corelib/animation/qparallelanimationgroup.cpp
index 0a04c14ff9..2d37d10eca 100644
--- a/src/corelib/animation/qparallelanimationgroup.cpp
+++ b/src/corelib/animation/qparallelanimationgroup.cpp
@@ -182,11 +182,11 @@ void QParallelAnimationGroup::updateCurrentTime(int currentTime)
/*!
\reimp
*/
-void QParallelAnimationGroup::updateState(QAbstractAnimation::State oldState,
- QAbstractAnimation::State newState)
+void QParallelAnimationGroup::updateState(QAbstractAnimation::State newState,
+ QAbstractAnimation::State oldState)
{
Q_D(QParallelAnimationGroup);
- QAnimationGroup::updateState(oldState, newState);
+ QAnimationGroup::updateState(newState, oldState);
switch (newState) {
case Stopped:
diff --git a/src/corelib/animation/qparallelanimationgroup.h b/src/corelib/animation/qparallelanimationgroup.h
index 1cab91e5c0..18ec885966 100644
--- a/src/corelib/animation/qparallelanimationgroup.h
+++ b/src/corelib/animation/qparallelanimationgroup.h
@@ -68,7 +68,7 @@ protected:
bool event(QEvent *event);
void updateCurrentTime(int currentTime);
- void updateState(QAbstractAnimation::State oldState, QAbstractAnimation::State newState);
+ void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState);
void updateDirection(QAbstractAnimation::Direction direction);
private:
diff --git a/src/corelib/animation/qpauseanimation.cpp b/src/corelib/animation/qpauseanimation.cpp
index 21e5b0849a..1b3b654b86 100644
--- a/src/corelib/animation/qpauseanimation.cpp
+++ b/src/corelib/animation/qpauseanimation.cpp
@@ -56,7 +56,7 @@
It is not necessary to construct a QPauseAnimation yourself.
QSequentialAnimationGroup provides the convenience functions
\l{QSequentialAnimationGroup::}{addPause()} and
- \l{QSequentialAnimationGroup::}{insertPauseAt()}. These functions
+ \l{QSequentialAnimationGroup::}{insertPause()}. These functions
simply take the number of milliseconds the pause should last.
\sa QSequentialAnimationGroup
diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp
index 4742e54953..30650831bc 100644
--- a/src/corelib/animation/qpropertyanimation.cpp
+++ b/src/corelib/animation/qpropertyanimation.cpp
@@ -250,8 +250,8 @@ void QPropertyAnimation::updateCurrentValue(const QVariant &value)
If the startValue is not defined when the state of the animation changes from Stopped to Running,
the current property value is used as the initial value for the animation.
*/
-void QPropertyAnimation::updateState(QAbstractAnimation::State oldState,
- QAbstractAnimation::State newState)
+void QPropertyAnimation::updateState(QAbstractAnimation::State newState,
+ QAbstractAnimation::State oldState)
{
Q_D(QPropertyAnimation);
@@ -260,7 +260,7 @@ void QPropertyAnimation::updateState(QAbstractAnimation::State oldState,
return;
}
- QVariantAnimation::updateState(oldState, newState);
+ QVariantAnimation::updateState(newState, oldState);
QPropertyAnimation *animToStop = 0;
{
diff --git a/src/corelib/animation/qpropertyanimation.h b/src/corelib/animation/qpropertyanimation.h
index 2e2ca3a2c2..61efed9958 100644
--- a/src/corelib/animation/qpropertyanimation.h
+++ b/src/corelib/animation/qpropertyanimation.h
@@ -73,7 +73,7 @@ public:
protected:
bool event(QEvent *event);
void updateCurrentValue(const QVariant &value);
- void updateState(QAbstractAnimation::State oldState, QAbstractAnimation::State newState);
+ void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState);
private:
Q_DISABLE_COPY(QPropertyAnimation)
diff --git a/src/corelib/animation/qsequentialanimationgroup.cpp b/src/corelib/animation/qsequentialanimationgroup.cpp
index 5ca560a1e5..861e26e78f 100644
--- a/src/corelib/animation/qsequentialanimationgroup.cpp
+++ b/src/corelib/animation/qsequentialanimationgroup.cpp
@@ -50,7 +50,7 @@
another has finished playing. The animations are played in the
order they are added to the group (using
\l{QAnimationGroup::}{addAnimation()} or
- \l{QAnimationGroup::}{insertAnimationAt()}). The animation group
+ \l{QAnimationGroup::}{insertAnimation()}). The animation group
finishes when its last animation has finished.
At each moment there is at most one animation that is active in
@@ -59,7 +59,7 @@
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() or insertPauseAt() to add a
+ groups. You can also call addPause() or insertPause() to add a
pause to a sequential animation group.
\code
@@ -269,7 +269,7 @@ QSequentialAnimationGroup::~QSequentialAnimationGroup()
\l{QAnimationGroup::animationCount()}{animationCount} will be
increased by one.
- \sa insertPauseAt(), QAnimationGroup::addAnimation()
+ \sa insertPause(), QAnimationGroup::addAnimation()
*/
QPauseAnimation *QSequentialAnimationGroup::addPause(int msecs)
{
@@ -282,19 +282,19 @@ QPauseAnimation *QSequentialAnimationGroup::addPause(int msecs)
Inserts a pause of \a msecs milliseconds at \a index in this animation
group.
- \sa addPause(), QAnimationGroup::insertAnimationAt()
+ \sa addPause(), QAnimationGroup::insertAnimation()
*/
-QPauseAnimation *QSequentialAnimationGroup::insertPauseAt(int index, int msecs)
+QPauseAnimation *QSequentialAnimationGroup::insertPause(int index, int msecs)
{
Q_D(const QSequentialAnimationGroup);
if (index < 0 || index > d->animations.size()) {
- qWarning("QSequentialAnimationGroup::insertPauseAt: index is out of bounds");
+ qWarning("QSequentialAnimationGroup::insertPause: index is out of bounds");
return 0;
}
QPauseAnimation *pause = new QPauseAnimation(msecs);
- insertAnimationAt(index, pause);
+ insertAnimation(index, pause);
return pause;
}
@@ -382,11 +382,11 @@ void QSequentialAnimationGroup::updateCurrentTime(int currentTime)
/*!
\reimp
*/
-void QSequentialAnimationGroup::updateState(QAbstractAnimation::State oldState,
- QAbstractAnimation::State newState)
+void QSequentialAnimationGroup::updateState(QAbstractAnimation::State newState,
+ QAbstractAnimation::State oldState)
{
Q_D(QSequentialAnimationGroup);
- QAnimationGroup::updateState(oldState, newState);
+ QAnimationGroup::updateState(newState, oldState);
if (!d->currentAnimation)
return;
@@ -532,7 +532,7 @@ void QSequentialAnimationGroupPrivate::animationInsertedAt(int index)
currentAnimationIndex = animations.indexOf(currentAnimation);
if (index < currentAnimationIndex || currentLoop != 0) {
- qWarning("QSequentialGroup::insertAnimationAt only supports to add animations after the current one.");
+ qWarning("QSequentialGroup::insertAnimation only supports to add animations after the current one.");
return; //we're not affected because it is added after the current one
}
}
diff --git a/src/corelib/animation/qsequentialanimationgroup.h b/src/corelib/animation/qsequentialanimationgroup.h
index f30f851f8b..97e7e01870 100644
--- a/src/corelib/animation/qsequentialanimationgroup.h
+++ b/src/corelib/animation/qsequentialanimationgroup.h
@@ -65,7 +65,7 @@ public:
~QSequentialAnimationGroup();
QPauseAnimation *addPause(int msecs);
- QPauseAnimation *insertPauseAt(int index, int msecs);
+ QPauseAnimation *insertPause(int index, int msecs);
QAbstractAnimation *currentAnimation() const;
int duration() const;
@@ -78,7 +78,7 @@ protected:
bool event(QEvent *event);
void updateCurrentTime(int);
- void updateState(QAbstractAnimation::State oldState, QAbstractAnimation::State newState);
+ void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState);
void updateDirection(QAbstractAnimation::Direction direction);
private:
diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp
index de8185bcbb..c7357783f2 100644
--- a/src/corelib/animation/qvariantanimation.cpp
+++ b/src/corelib/animation/qvariantanimation.cpp
@@ -621,8 +621,8 @@ bool QVariantAnimation::event(QEvent *event)
/*!
\reimp
*/
-void QVariantAnimation::updateState(QAbstractAnimation::State oldState,
- QAbstractAnimation::State newState)
+void QVariantAnimation::updateState(QAbstractAnimation::State newState,
+ QAbstractAnimation::State oldState)
{
Q_UNUSED(oldState);
Q_UNUSED(newState);
diff --git a/src/corelib/animation/qvariantanimation.h b/src/corelib/animation/qvariantanimation.h
index bc57b1c076..89d9b3425c 100644
--- a/src/corelib/animation/qvariantanimation.h
+++ b/src/corelib/animation/qvariantanimation.h
@@ -103,7 +103,7 @@ protected:
bool event(QEvent *event);
void updateCurrentTime(int);
- void updateState(QAbstractAnimation::State oldState, QAbstractAnimation::State newState);
+ void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState);
virtual void updateCurrentValue(const QVariant &value) = 0;
virtual QVariant interpolated(const QVariant &from, const QVariant &to, qreal progress) const;