[Qt-interest] Executing code after QApplication::exec() without user intervention

william.crocker at analog.com william.crocker at analog.com
Tue Apr 27 19:25:10 CEST 2010


>>
>> How do have a method executed automatically after the main event loop 
>> (app->exec()) has started?  This is for the case where the application 
>> takes a command-line argument to open a file.  Right now, this is simply 
>> done the usual way, through the application's "File->Open" menu.  But 
>> providing a filename as a command-line arg means I need to open the file 
>> without user intervention.
>

Use a singleShot timer.
I'm pretty sure the timer will not actually
be serviced until you enter the event loop.

Bill



More information about the Qt-interest-old mailing list