reversingMode(QDeclarativeSmoothedAnimation::Eased), initialVelocity(0),
trackVelocity(0), initialValue(0), invert(false), finalDuration(-1), lastTime(0)
{
- delayedStopTimer.setInterval(DELAY_STOP_TIMER_INTERVAL);
- delayedStopTimer.setSingleShot(true);
- connect(&delayedStopTimer, SIGNAL(timeout()), this, SLOT(stop()));
}
void QSmoothedAnimation::restart()
init();
}
+void QSmoothedAnimation::timerEvent(QTimerEvent *event)
+{
+ if (event->timerId() == delayedStopTimer.timerId()) {
+ delayedStopTimer.stop();
+ stop();
+ } else {
+ QAbstractAnimation::timerEvent(event);
+ }
+}
+
void QSmoothedAnimation::delayedStop()
{
if (!delayedStopTimer.isActive())
- delayedStopTimer.start();
+ delayedStopTimer.start(DELAY_STOP_TIMER_INTERVAL, this);
}
int QSmoothedAnimation::duration() const
#include <qparallelanimationgroup.h>
#include <private/qobject_p.h>
-#include <QTimer>
+#include <QBasicTimer>
QT_BEGIN_NAMESPACE
protected:
virtual void updateCurrentTime(int);
virtual void updateState(QAbstractAnimation::State, QAbstractAnimation::State);
+ virtual void timerEvent(QTimerEvent *);
private:
qreal easeFollow(qreal);
bool recalc();
void delayedStop();
- QTimer delayedStopTimer;
+ QBasicTimer delayedStopTimer;
};
class QDeclarativeSmoothedAnimationPrivate : public QDeclarativePropertyAnimationPrivate