summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/src/declarative/qtdeclarative.qdoc17
-rw-r--r--src/declarative/util/qmltimer.cpp2
-rw-r--r--tests/auto/declarative/qmltimer/tst_qmltimer.cpp9
3 files changed, 28 insertions, 0 deletions
diff --git a/doc/src/declarative/qtdeclarative.qdoc b/doc/src/declarative/qtdeclarative.qdoc
index 5947429..6a94b6e 100644
--- a/doc/src/declarative/qtdeclarative.qdoc
+++ b/doc/src/declarative/qtdeclarative.qdoc
@@ -47,4 +47,21 @@
\brief The Qt Declarative module provides a declarative framework for building
highly dynamic, custom user interfaces.
+To include the definitions of the module's classes, use the
+following directive:
+
+\code
+#include <QtDeclarative>
+\endcode
+
+To link against the module, add this line to your \l qmake \c
+.pro file:
+
+\code
+QT += declarative
+\endcode
+
+For more information on the Qt Declarative module, see the
+\l{declarativeui.html}{Declarative UI} documentation.
+
*/
diff --git a/src/declarative/util/qmltimer.cpp b/src/declarative/util/qmltimer.cpp
index da60193..9b54337 100644
--- a/src/declarative/util/qmltimer.cpp
+++ b/src/declarative/util/qmltimer.cpp
@@ -303,7 +303,9 @@ void QmlTimer::finished()
if (d->repeating || !d->running)
return;
emit triggered();
+ d->running = false;
d->firstTick = false;
+ emit runningChanged();
}
QT_END_NAMESPACE
diff --git a/tests/auto/declarative/qmltimer/tst_qmltimer.cpp b/tests/auto/declarative/qmltimer/tst_qmltimer.cpp
index 63a9a09..d681fbb 100644
--- a/tests/auto/declarative/qmltimer/tst_qmltimer.cpp
+++ b/tests/auto/declarative/qmltimer/tst_qmltimer.cpp
@@ -105,6 +105,7 @@ void tst_qmltimer::notRepeating()
QCOMPARE(helper.count, 1);
QTest::qWait(TIMEOUT_TIMEOUT);
QCOMPARE(helper.count, 1);
+ QVERIFY(timer->isRunning() == false);
}
void tst_qmltimer::notRepeatingStart()
@@ -126,6 +127,7 @@ void tst_qmltimer::notRepeatingStart()
QCOMPARE(helper.count, 1);
QTest::qWait(TIMEOUT_TIMEOUT);
QCOMPARE(helper.count, 1);
+ QVERIFY(timer->isRunning() == false);
delete timer;
}
@@ -147,11 +149,14 @@ void tst_qmltimer::repeat()
QTest::qWait(TIMEOUT_TIMEOUT);
QVERIFY(helper.count > oldCount);
+ QVERIFY(timer->isRunning());
oldCount = helper.count;
timer->stop();
+
QTest::qWait(TIMEOUT_TIMEOUT);
QVERIFY(helper.count == oldCount);
+ QVERIFY(timer->isRunning() == false);
delete timer;
}
@@ -173,6 +178,7 @@ void tst_qmltimer::triggeredOnStart()
QCOMPARE(helper.count, 2);
QTest::qWait(TIMEOUT_TIMEOUT);
QCOMPARE(helper.count, 2);
+ QVERIFY(timer->isRunning() == false);
delete timer;
}
@@ -194,6 +200,7 @@ void tst_qmltimer::triggeredOnStartRepeat()
int oldCount = helper.count;
QTest::qWait(TIMEOUT_TIMEOUT);
QVERIFY(helper.count > oldCount);
+ QVERIFY(timer->isRunning());
delete timer;
}
@@ -234,6 +241,7 @@ void tst_qmltimer::changeDuration()
QTest::qWait(600);
QCOMPARE(helper.count, 3);
+ QVERIFY(timer->isRunning());
delete timer;
}
@@ -259,6 +267,7 @@ void tst_qmltimer::restart()
QTest::qWait(700);
QCOMPARE(helper.count, 2);
+ QVERIFY(timer->isRunning());
delete timer;
}