diff options
Diffstat (limited to 'src/corelib/animation/qabstractanimation.cpp')
-rw-r--r-- | src/corelib/animation/qabstractanimation.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index fd63b25a76..830c5da6b6 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -168,7 +168,7 @@ Q_GLOBAL_STATIC(QThreadStorage<QUnifiedTimer *>, unifiedTimer) QUnifiedTimer::QUnifiedTimer() : QObject(), defaultDriver(this), lastTick(0), timingInterval(DEFAULT_TIMER_INTERVAL), currentAnimationIdx(0), insideTick(false), consistentTiming(false), slowMode(false), - slowdownFactor(5.0f), isPauseTimerActive(false), runningLeafAnimations(0) + slowdownFactor(5.0f), isPauseTimerActive(false), runningLeafAnimations(0), profilerCallback(0) { time.invalidate(); driver = &defaultDriver; @@ -234,12 +234,20 @@ void QUnifiedTimer::updateAnimationsTime(qint64 timeStep) int elapsed = QAbstractAnimationPrivate::get(animation)->totalCurrentTime + (animation->direction() == QAbstractAnimation::Forward ? delta : -delta); animation->setCurrentTime(elapsed); + + if (profilerCallback) + profilerCallback(delta); } insideTick = false; currentAnimationIdx = 0; } } +void QUnifiedTimer::registerProfilerCallback(void (*cb)(qint64)) +{ + profilerCallback = cb; +} + void QUnifiedTimer::updateAnimationTimer() { QUnifiedTimer *inst = QUnifiedTimer::instance(false); |