Hello,
I'm trying to learn about qtScript. I would like to know if it is possible to use the setTimeout Javascript function.
For that I'm creating a PushButton, connecting the onclick signal to a JS function who will call the setTimeout function, but it does not work.
I can modify the text of the Pushbutton and connect a JS function to it. Here the code of my js file:
button.clicked.connect(onButtonClicked);
function onButtonClicked(checked) {
button.text = qsTr('onClick!');
setTimeout("timedCount()", 1000);
}
function timedCount()
{
button.text = qsTr('TimedCount!');
}
When I click on the button it displays the "onClick' text, but the setTimeout does not work
Any ideas??
Bookmarks