From 4c0c1cbcdecec95c046a6862628621f005c2df56 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 25 Jun 2009 15:11:31 +1000 Subject: QmlTimer::firesOnStart -> triggeredOnStart --- src/declarative/extra/qmltimer.cpp | 20 ++++++++++---------- src/declarative/extra/qmltimer.h | 7 ++++--- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/declarative/extra/qmltimer.cpp b/src/declarative/extra/qmltimer.cpp index b891745..4af83d3 100644 --- a/src/declarative/extra/qmltimer.cpp +++ b/src/declarative/extra/qmltimer.cpp @@ -54,12 +54,12 @@ class QmlTimerPrivate : public QObjectPrivate Q_DECLARE_PUBLIC(QmlTimer) public: QmlTimerPrivate() - : interval(1000), running(false), repeating(false), firesOnStart(false) + : interval(1000), running(false), repeating(false), triggeredOnStart(false) , componentComplete(false) {} int interval; bool running; bool repeating; - bool firesOnStart; + bool triggeredOnStart; QPauseAnimation pause; bool componentComplete; }; @@ -165,24 +165,24 @@ void QmlTimer::setRepeating(bool repeating) } /*! - \qmlproperty bool Timer::firesOnStart + \qmlproperty bool Timer::triggeredOnStart - If \a firesOnStart is true, the timer will be triggered immediately + If \a triggeredOnStart is true, the timer will be triggered immediately when started, and subsequently at the specified interval. \sa running */ -bool QmlTimer::firesOnStart() const +bool QmlTimer::triggeredOnStart() const { Q_D(const QmlTimer); - return d->firesOnStart; + return d->triggeredOnStart; } -void QmlTimer::setFiresOnStart(bool firesOnStart) +void QmlTimer::setTriggeredOnStart(bool triggeredOnStart) { Q_D(QmlTimer); - if (d->firesOnStart != firesOnStart) { - d->firesOnStart = firesOnStart; + if (d->triggeredOnStart != triggeredOnStart) { + d->triggeredOnStart = triggeredOnStart; update(); } } @@ -197,7 +197,7 @@ void QmlTimer::update() d->pause.setLoopCount(d->repeating ? -1 : 1); d->pause.setDuration(d->interval); d->pause.start(); - if (d->firesOnStart) { + if (d->triggeredOnStart) { QCoreApplication::removePostedEvents(this, QEvent::MetaCall); QMetaObject::invokeMethod(this, "ticked", Qt::QueuedConnection); } diff --git a/src/declarative/extra/qmltimer.h b/src/declarative/extra/qmltimer.h index 8a94395..8171385 100644 --- a/src/declarative/extra/qmltimer.h +++ b/src/declarative/extra/qmltimer.h @@ -57,10 +57,11 @@ class Q_DECLARATIVE_EXPORT QmlTimer : public QObject, public QmlParserStatus { Q_OBJECT Q_DECLARE_PRIVATE(QmlTimer) + Q_INTERFACES(QmlParserStatus) Q_PROPERTY(int interval READ interval WRITE setInterval) Q_PROPERTY(bool running READ isRunning WRITE setRunning NOTIFY runningChanged) Q_PROPERTY(bool repeat READ isRepeating WRITE setRepeating) - Q_PROPERTY(bool firesOnStart READ firesOnStart WRITE setFiresOnStart) + Q_PROPERTY(bool triggeredOnStart READ triggeredOnStart WRITE setTriggeredOnStart) public: QmlTimer(QObject *parent=0); @@ -74,8 +75,8 @@ public: bool isRepeating() const; void setRepeating(bool repeating); - bool firesOnStart() const; - void setFiresOnStart(bool firesOnStart); + bool triggeredOnStart() const; + void setTriggeredOnStart(bool triggeredOnStart); protected: void componentComplete(); -- cgit v0.12