summaryrefslogtreecommitdiffstats
path: root/src/declarative/util/qmltimer.cpp
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-07-28 05:49:42 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-07-28 05:49:42 (GMT)
commite87124ba02669e1dbffb803441e1fc25b7e7d959 (patch)
tree0550221cabcb2bfe508a89d4a0d822314f6c8173 /src/declarative/util/qmltimer.cpp
parent503daaebc71e88d7e80bbf51973f0c695127eab2 (diff)
downloadQt-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.cpp11
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);