PDA

View Full Version : QSA scripts: how to wait for events?



olberg
14th May 2006, 15:22
Hi,

I have a Qt application with support for QSA scripts. Everything works fine, except that I need a way to put my scripts to sleep while my Application is performing a certain job. How can I wait for given number of seconds without freezing the application, alternatively, how can I wait until a certain signal from the application arrives?

/Michael

gadnio
16th May 2006, 15:55
Why don't you use QThread for this job?

olberg
17th May 2006, 15:56
Thanks, I thought about that, too. It brings me to another question. How do I create standard Qt Objects in my script? Right now all I have access to are the objects which I explicitely make available through 'addObject' calls. How do I make the hierarchy of Qt objects, like QButton's, QString and QThread available to QSA scripts?

e.g.

var dlg = new QPushButton("hello");

produces " use of undefined variable 'QPushButton' "

/Michael