1

I tried this snippet suggested elsewhere on SO:

var timer = new QTimer();
timer.interval = 100; // set the time in milliseconds
timer.singleShot = true; // in-case if setTimout and false in-case of setInterval 
timer.timeout.connect(this, function(){console("in setTimout")});
timer.start();

Result:

ReferenceError: Can't find variable: QTimer

Is there anything I need to set up for timers to work?

Community
  • 1
  • 1
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
  • I don't think that the "snippet" that was suggested in the referenced post has ever worked. You need to look at the other answer that refers the context2d example, and specifically at its [Environment](http://stackoverflow.com/a/24338852/1329652) class. QtScript doesn't just expose Qt classes to javascript like that. – Kuba hasn't forgotten Monica Mar 29 '16 at 21:16
  • See the answer I added to the original question. – Kuba hasn't forgotten Monica Mar 30 '16 at 12:59

0 Answers0