qtopia-interest@trolltech.com
[Top] [All Lists]

Re: [Qtopia-interest] QWidget: Must construct a QApplication before a QP

Subject: Re: [Qtopia-interest] QWidget: Must construct a QApplication before a QPaintDevice
From: Harri Porten
Date: Sat, 21 Jun 2008 11:28:07 +0200 CEST
Hi!

On Sat, 21 Jun 2008, mohammed shareef wrote:

> QWidget: Must construct a QApplication before a QPaintDevice

[...]

> QDialog *window1 = new QDialog;
> QDialog *window2 = new QDialog;

QDialogs are QWidgets which again are QPaintDevices. And by new'ing those 
global objects in the initialization phase you are (as the error message) 
says construction QPaintDevices before QApplication (in main()).

If you need global pointers better initialize them on-demand, i.e. before 
first only. Despite from above limitation of QPaintDevice there is also 
the problem of an undefined order of global constructor runs.

Harri.
_______________________________________________
Qtopia-interest mailing list
Qtopia-interest@xxxxxxxxxxxxx
http://lists.trolltech.com/mailman/listinfo/qtopia-interest

<Prev in Thread] Current Thread [Next in Thread>