summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/declarative/QmlChanges.txt2
-rw-r--r--src/declarative/util/qmltimer.cpp26
-rw-r--r--src/declarative/util/qmltimer.h4
3 files changed, 31 insertions, 1 deletions
diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt
index 77839e8..82f2292 100644
--- a/src/declarative/QmlChanges.txt
+++ b/src/declarative/QmlChanges.txt
@@ -22,6 +22,7 @@ MouseRegion: ymin -> maximumY
Additions:
MouseRegion: add "acceptedButtons" property
MouseRegion: add "hoverEnabled" property
+Timer: add start() and stop() slots
Deletions:
VerticalPositioner: lost "margins" property
@@ -57,4 +58,3 @@ PropertyAction::target (if possible)
Additions:
MouseRegion: add "pressedButtons" property
Connection: add "slot" property
-Timer: add start() and stop() slots
diff --git a/src/declarative/util/qmltimer.cpp b/src/declarative/util/qmltimer.cpp
index 2d3a343..b95d6ad 100644
--- a/src/declarative/util/qmltimer.cpp
+++ b/src/declarative/util/qmltimer.cpp
@@ -188,6 +188,32 @@ void QmlTimer::setTriggeredOnStart(bool triggeredOnStart)
}
}
+/*!
+ \qmlmethod Timer::start()
+ \brief Starts the timer.
+
+ If the timer is already running, calling this method has no effect. The
+ \c running property will be true following a call to \c start().
+*/
+void QmlTimer::start()
+{
+ Q_D(QmlTimer);
+ d->pause.start();
+}
+
+/*!
+ \qmlmethod Timer::stop()
+ \brief stops the timer.
+
+ If the timer is not running, calling this method has no effect. The
+ \c running property will be false following a call to \c stop().
+*/
+void QmlTimer::stop()
+{
+ Q_D(QmlTimer);
+ d->pause.stop();
+}
+
void QmlTimer::update()
{
Q_D(QmlTimer);
diff --git a/src/declarative/util/qmltimer.h b/src/declarative/util/qmltimer.h
index d376834..22478cb 100644
--- a/src/declarative/util/qmltimer.h
+++ b/src/declarative/util/qmltimer.h
@@ -83,6 +83,10 @@ protected:
void classBegin();
void componentComplete();
+public Q_SLOTS:
+ void start();
+ void stop();
+
Q_SIGNALS:
void triggered();
void runningChanged();