diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-11-06 08:55:08 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-11-06 08:55:08 (GMT) |
commit | a708f07b593359b6bf5732ec444336956e194cda (patch) | |
tree | 43609c235899eef74a9d80a1762fcaad1c644071 /src/corelib | |
parent | dde02a1b8c61c344c20a92a81d25d4c9b522d349 (diff) | |
download | Qt-a708f07b593359b6bf5732ec444336956e194cda.zip Qt-a708f07b593359b6bf5732ec444336956e194cda.tar.gz Qt-a708f07b593359b6bf5732ec444336956e194cda.tar.bz2 |
add slow mode in private API for testing
this was suggested by Michael B
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/animation/qabstractanimation.cpp | 6 | ||||
-rw-r--r-- | src/corelib/animation/qabstractanimation_p.h | 4 |
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; |