[Qgis-developer] QGis 1.6.0 Debug error

Martin Dobias wonder.sk at gmail.com
Thu May 12 05:03:09 EDT 2011


On Mon, May 9, 2011 at 10:53 AM, sttsx <ssolak at tai.com.tr> wrote:
> ________________
> Debug Error
> Program:...
> Module:4.7.2
> Fine:global\qglobal.cpp
> Line:2262
>
> QWidget:Must construct a QApplication before a QPaintDevice.
> _________________
>
> The main function of my appliaction is:
>
> int main(int argc,char *argv[]){
> QgsApplication app(argc,argv,TRUE);
> MainWindow* mypMainWindow = new MainWindow();   //
> mypMainWindow->show();
> app.exec();
> }

Does it help if you change QgsApplication to QApplication? If not, you
are doing probably something wrong, like having a global or static
variable inherited from QWidget which tries to initialize itself
before the application actually starts.

Martin


More information about the Qgis-developer mailing list