From 74aee53beb00f13fdcfcdaa0657aff259d7c962b Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 26 Nov 2009 10:54:45 +1000 Subject: Ensure running is set to false when the timer stops. --- src/declarative/util/qmltimer.cpp | 2 ++ tests/auto/declarative/qmltimer/tst_qmltimer.cpp | 9 +++++++++ 2 files changed, 11 insertions(+) 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; } -- cgit v0.12 From 0204bc0a7031d017f8999bc73005fab46cc59d5e Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 26 Nov 2009 13:54:21 +1000 Subject: Doc. --- doc/src/declarative/qtdeclarative.qdoc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 +\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. + */ -- cgit v0.12