Not much to add; what is the equivalent of JavaScript\'s setTimeout on qtScript?
Qt provides an example in the 'context2d' project a way to access to the setInterval/clearInterval setTimeout/clearTimeout functionalities from the script.
In the 'Environment' class of this project, the startTimer function of a QObject is called each time that the script invokes setInterval/setTimeout. Then the timer identifier is added in a QHash with a reference on the javascript callback. When the countdown of the timer (c++ part) is over, the timerEvent of the 'Environment' class is called and then the javascript callback called..
Note that all the timers are killed in the Environment::reset() in order to clean the context.
see: https://doc.qt.io/archives/qt-4.7/script-context2d.html