[PyKDE] Opinions on pyuic Custom Widget Support

Phil Thompson phil at river-bank.demon.co.uk
Sat Dec 14 12:11:01 GMT 2002


I've been prompted to look at improving pyuic's support for custom widgets.

At the moment, if you use a custom widget, pyuic will generate the following 
at the start of the module...

from modname import widgetname

...where "widgetname" is the class name of the custom widget - no problem 
there. "modname" is the value entered in the Headerfile field of the Edit 
Custom Widgets dialog with the .h extension removed. While this works, I'm 
told it isn't particularly useful. It also makes dubious assumptions about 
how custom widgets have been packaged into modules and make it less easy to 
satisfy both uic and pyuic.

I propose to remove this behaviour.

A more generic, think about it for 2 minutes, solution is to allow Python code 
to be embedded in the Comment field of the Form Settings dialog. Any line 
beginning with "Python:" will be copied to the generated module. This is then 
completely flexible.

Before I go ahead and implement this, does anybody have any better 
suggestions? Or additional things that could be done for common cases (like 
support for PyKDE widgets).

Phil




More information about the PyQt mailing list