[Interest] Plugin -> QEventLoop without QApplication

Guido Seifert Wargand at gmx.de
Fri Feb 15 13:08:00 CET 2013


Arrghh.... found the problem. The main program was compiled in release mode and the plugin was compiled in debug mode. Strange, there was once a time when this was refused by the QPluginLoader. In my case the plugin was loaded, all simple functions worked, but I could not start a local eventloop because qApp was 0.

Guido


-------- Original-Nachricht --------
> Datum: Fri, 15 Feb 2013 11:32:15 +0100
> Von: "Guido Seifert" <Wargand at gmx.de>
> An: interest at qt-project.org
> Betreff: [Interest] Plugin -> QEventLoop without QApplication

> Hi,
> 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? 
> 
> Guido
> 
> 
> 
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list