3 beginner questions!

Alex Martelli aleax at aleax.it
Tue May 6 14:36:52 EDT 2003


Ali Dada wrote:

> hi all:
> 
> first question (PyQt):
> i am using the Qt designer that comes with RedHat9 to design a simple .ui
> form, then i am saying:
> 
> $ pyuic form.ui > form.py
> 
> which successfully generates python code which includes a class definition
> that is supposed to generate the form. i am adding a line to the code to
> create an instance of the class so that i get a window or form or anything
> useful. when i execute the modified code i get the following line on
> stdout:
>  
> QPaintDevice: Must construct a QApplication before a QPaintDevice

Don't modify the files generated by pyuic -- they'll be overwritten
next time you change the .ui file and regenerate the .py!  Rather,
if you need changes, do them by inheritance after importing the file.

Before *instantiating* widgets, you need to instantiate QApplication.
Did you do that...?


Alex





More information about the Python-list mailing list