[Qt-qml] Sleeping in javascript

Mateu Batle mateu.batle at collabora.co.uk
Tue Sep 28 00:28:45 CEST 2010


 Hi Alex,

one way could be to create a dynamic QML Timer object and customize it

http://doc.qt.nokia.com/4.7-snapshot/qml-timer.html

But maybe there is another solution depending on the specific usage,
what do you need the timeout for ?

cheers
  Mat


On 09/27/2010 02:59 PM, Alex wrote:
> Hi,
>
> I know javascript doesn't have a sleep() per se, but I've tried using
> the setTimeout() function, which I thought was standard, like so:
>
>         setTimeout("console.log(\"foo\")", 1000)
>
> This is the result:
>
>         ReferenceError: Can't find variable: setTimeout
>
> What is the recommended way to pause/sleep within a javascript block?
>
> Thanks,
> Alex
> _______________________________________________
> Qt-qml mailing list
> Qt-qml at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-qml


-- 
Mateu Batle
Software Engineer
Collabora Ltd.




More information about the Qt-qml mailing list