diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-07-28 05:49:42 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-07-28 05:49:42 (GMT) |
commit | e87124ba02669e1dbffb803441e1fc25b7e7d959 (patch) | |
tree | 0550221cabcb2bfe508a89d4a0d822314f6c8173 /src/declarative/util/qmltimer.cpp | |
parent | 503daaebc71e88d7e80bbf51973f0c695127eab2 (diff) | |
download | Qt-e87124ba02669e1dbffb803441e1fc25b7e7d959.zip Qt-e87124ba02669e1dbffb803441e1fc25b7e7d959.tar.gz Qt-e87124ba02669e1dbffb803441e1fc25b7e7d959.tar.bz2 |
Don't wait for componentComplete if never a classBegin.
Otherwise QmlTimer cannot be used outside QML.
Diffstat (limited to 'src/declarative/util/qmltimer.cpp')
-rw-r--r-- | src/declarative/util/qmltimer.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/declarative/util/qmltimer.cpp b/src/declarative/util/qmltimer.cpp index 456b2ef..2d3a343 100644 --- a/src/declarative/util/qmltimer.cpp +++ b/src/declarative/util/qmltimer.cpp @@ -55,12 +55,13 @@ class QmlTimerPrivate : public QObjectPrivate public: QmlTimerPrivate() : interval(1000), running(false), repeating(false), triggeredOnStart(false) - , componentComplete(false) {} + , classBegun(false), componentComplete(false) {} int interval; bool running; bool repeating; bool triggeredOnStart; QPauseAnimation pause; + bool classBegun; bool componentComplete; }; @@ -190,7 +191,7 @@ void QmlTimer::setTriggeredOnStart(bool triggeredOnStart) void QmlTimer::update() { Q_D(QmlTimer); - if (!d->componentComplete) + if (d->classBegun && !d->componentComplete) return; d->pause.stop(); if (d->running) { @@ -204,6 +205,12 @@ void QmlTimer::update() } } +void QmlTimer::classBegin() +{ + Q_D(QmlTimer); + d->classBegun = true; +} + void QmlTimer::componentComplete() { Q_D(QmlTimer); |