[Qt-interest] QWidget: Must construct a QApplication before a QPaintDevice

Yifei Li yifli at mtu.edu
Mon Sep 5 17:34:19 CEST 2011


Sorry for the confusion. It's not the real code.

The real code is:

int main(int argc, char* argv[])
{
     QApplication app(argc,argv);
    ….
     return app.exec();
}

I don't have any static plugins, all of them are dynamic libraries.

One thing I need to mention is that all the plugins now have the extension "so" instead of "dylib".  This is because now I use "add_library(target MODULE)" instead of "add_library(target SHARED)"  (I use cmake)

I don't know if this matters.

Yifei

On Sep 5, 2011, at 10:09 AM, BOUCARD Olivier wrote:

> Hi,
> 
> Is there the real code? Because QApplication app(); does not work at all...
> 
> Do you have static plugins?
> 
> 
> De : Yifei Li <yifli at mtu.edu>
> À : qt-interest at trolltech.com
> Envoyé le : Lundi 5 Septembre 2011 15h59
> Objet : [Qt-interest] QWidget: Must construct a QApplication before a QPaintDevice
> 
> Hi all,
> 
> I got this error when running an application (once working with Qt-4.6.2 on Snow Leopard) after I switch to Qt-4.8.0 on Lion.
> 
> The error occurs when I construct a QWidget in a plugin loaded by the main application. My application works as follows:
> 
> void main()
> {
>     QApplication app();
> 
>     // in Core's constructor, plugins are loaded using QPluginLoader
>     Core core;        
>   
>     return app.exec();
> }
> 
> Any idea how to solve this? Thanks
> 
> Yifei
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
> 
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110905/6245d6bb/attachment.html 


More information about the Qt-interest-old mailing list