summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/animation/qabstractanimation.cpp6
-rw-r--r--src/corelib/animation/qabstractanimation_p.h4
2 files changed, 8 insertions, 2 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 3b98152..93ac840 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -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)
{
}
@@ -193,6 +193,8 @@ void QUnifiedTimer::updateAnimationsTime()
// ignore consistentTiming in case the pause timer is active
const 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
diff --git a/src/corelib/animation/qabstractanimation_p.h b/src/corelib/animation/qabstractanimation_p.h
index f989bce..720e68d 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;