Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
Qt for MCUs 2.5.1
-
None
-
-
7af9138dd13658a81e329f02dd406556282624a5
-
All
Description
This problem is that if you bind a bool property to running and manipulate True or False from the outside, the timer will never work again.
The following program binds the active property to running.
If you swap the active's true and false in the switch element, the timer will not work from the second time.
Rectangle { id : rect property bool active:false Timer { id: timer running: rect.active interval: 500 onTriggered: { // if the running property evaluates to false on Triggered, // the "running" property will have never been to set true again even if the binded property is true. rect.active = false console.log("fire") } } Switch { anchors.bottom: parent.bottom onClicked: { rect.active = checked } } }
P.S.
the repeat is true, the timer starts again except the above triggered comments.
if the repeat is false, the timer never starts again.