From a9ad8886fe25276ea6e81e191392d4c90d207759 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 14 Dec 2011 10:29:34 +1000 Subject: Fix possible jump in animation timer. When starting new animations with existing animations running, ensure we force an update to the timer first, so that the new animations can't mistakenly start with a very large delta. This fixes tst_qdeclarativeanimations::alwaysRunToEndRestartBug failure on slow machines. Change-Id: Ida4e5dcf0ff792e6bfe0d244b6e969d04d0b20fa Reviewed-by: Martin Jones --- src/corelib/animation/qabstractanimation.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/corelib/animation/qabstractanimation.cpp') diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index 71eb9c9f9c..a7d428384a 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -286,6 +286,10 @@ void QUnifiedTimer::setTimingInterval(int interval) void QUnifiedTimer::startAnimations() { startAnimationPending = false; + //force timer to update, which prevents large deltas for our newly added animations + if (!animations.isEmpty()) + updateAnimationsTime(-1); + //we transfer the waiting animations into the "really running" state animations += animationsToStart; animationsToStart.clear(); -- cgit v1.2.3