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

Andre Somers andre at familiesomers.nl
Mon Aug 31 17:22:36 CEST 2009


Hi,

I am experiencing a weird problem. When I compile my program with the 
release flag, I get the above error if I run it through the debugger. If 
I run it directly, it aborts with a code 3. However, when I compile a 
debug version of my program, the problem does not occur.

The problem is weird anyway, because in my main function, the first 
thing I do is construct a QApplication. Here is my main function:

int main(int argc, char *argv[])

{

QApplication app(argc, argv);

app.setOrganizationName("Rathenau Instituut");

app.setOrganizationDomain("rathenau.nl");

app.setApplicationName("RelationCalculator");

app.setApplicationVersion(QString(__DATE__));

DesignerInterface w;

w.show();

RelationCalculatorCore::instance();

return app.exec();

}


DesignerInterface is my main ui.


Because the problem only occurs in release mode, it is very hard to 
trace back this problem. Can anyone provide a pointer what may be 
happening here?


André







More information about the Qt-interest-old mailing list