[Interest] Plugin -> QEventLoop without QApplication

Guido Seifert Wargand at gmx.de
Fri Feb 15 11:32:15 CET 2013

I have a little problem here.
I have a program, which loads a plugin using QPluginLoader. The plugins contains a QThread. In the QThread's run funtion I start an eventloop with exec().

If I use the gcc under Linux or the mingw under Windows everything works perfectly.

But now I wanted to compile it with Visual Studio 2010.
Compiles fine, but I get the response when the program starts:
QEventLoop: Cannot be used without QApplication.

So, of course I thought that I did something stupid. Some static stuff, which starts the QThread before the main eventloop is started. Maybe this bug isn't triggered by gcc/mingw code due to slightly different timing.

But no such luck. The function in the plugin, which starts the thread and therefore the thread's eventloop is called in a slot in the main program. 
The slot is connected with Qt::QueuedConnection type. So if I am not missing some crucial information, I'd say the main eventloop must be running, when the thread is started. 

Any ideas? Some Visual Studio secrets I am missing? 


More information about the Interest mailing list