QPaintDevice: Must construct a QApplication before a QPaintDevice

boris.smirnov at gmail.com boris.smirnov at gmail.com
Tue Feb 27 06:00:41 EST 2007


On Feb 27, 11:56 am, "Diez B. Roggisch" <d... at nospam.web.de> wrote:
> > Yes that I can deduce, but why I'm asking is why it's different on
> > Windows and Linux. Should it not be platform independent?
>
> It should be. I've got no idea why it seems to work on windows but I can say
> one thing for sure: that would be an artifact that you shouldn't rely on.
> In Qt, you _always_ need a QApplication for anything. So just do as it
> requires you to do: first, construct a QApplication. Then things will work.
>
> Diez

Hmm, as I see the code, I do construct QApplication as first

if __name__ == '__main__':
  a = QApplication (sys.argv)
  mywidget = Optimizer()
  a.setMainWidget (mywidget)
  mywidget.show()
  Update_StatusLine(mywidget)
  mywidget.setStartconfig()
  a.exec_loop     ()




More information about the Python-list mailing list