Exemplo n.º 1
0
void QUnifiedTimer::timerEvent(QTimerEvent *event)
{
    //in the case of consistent timing we make sure the order in which events come is always the same
    //for that purpose we do as if the startstoptimer would always fire before the animation timer
    if (consistentTiming) {
        if (stopTimerPending)
            stopTimer();
        if (startTimersPending)
            startTimers();
    }

    if (event->timerId() == pauseTimer.timerId()) {
        // update current time on all timers
        updateAnimationTimers(-1);
        restart();
    }
}
Exemplo n.º 2
0
void QUnifiedTimer::startTimers()
{
    startTimersPending = false;
    if (!animationTimers.isEmpty())
        updateAnimationTimers(-1);

    //we transfer the waiting animations into the "really running" state
    animationTimers += animationTimersToStart;
    animationTimersToStart.clear();
    if (!animationTimers.isEmpty()) {
        localRestart();
        if (!time.isValid()) {
            lastTick = 0;
            time.start();
        }
    }
}
Exemplo n.º 3
0
void QUnifiedTimer::maybeUpdateAnimationsToCurrentTime()
{
    if (time.elapsed() - lastTick > 50)
        updateAnimationTimers(driver->elapsed());
}
Exemplo n.º 4
0
void QUnifiedTimer::maybeUpdateAnimationsToCurrentTime()
{
    if (elapsed() - lastTick > 50)
        updateAnimationTimers(-1);
}