Fix QML Timer running not being updated together with triggered signal
authorTroels Nilsson <nilsson.troels@gmail.com>
Wed, 21 Jan 2015 13:18:35 +0000 (14:18 +0100)
committerLars Knoll <lars.knoll@digia.com>
Wed, 11 Feb 2015 18:36:10 +0000 (18:36 +0000)
commitc6f0e3967992780e7786d6bdd90b21149009f2fd
tree47b29cc8cbc8166889bbc060cbb22e65d140f0c5
parent890082091b93dae1df895eda92bbb64675d29fbc
Fix QML Timer running not being updated together with triggered signal

The running property of the QML Timer should be updated at the same
time as the triggered signal is emitted, otherwise code like e.g. the following:
    if (qmlTimer.running)
    {
        qmlTimer.stop()
    }
doesn't work as expected. In addition if the timer is stopped or restarted
between posting the QEvent_Triggered event and receiving it, the triggered
event should not be emitted. This avoids the issue of stopped timers still
emitting the triggered signal which can potentially cause problems in
existing code.

Task-number: QTBUG-44026
Change-Id: Ia14d80d152967d09adc1586467715b2e1c6662cc
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
src/qml/types/qqmltimer.cpp
tests/auto/qml/qqmltimer/tst_qqmltimer.cpp