[PyKDE] PyQt4 custom widgets

Andreas Pakulat apaku at gmx.de
Wed Jan 11 00:21:14 GMT 2006

On 10.01.06 10:42:03, Torsten Marek wrote:
> > Couldn't let it lie around ;-)
> > 
> > So here's a small patch which makes empty extends-Elements work and also
> > "corrects" the import statements by simply transforming whatever is in
> > the header-element to a pythonic module-path. 
> > 
> > The latter means that a string like
> > 
> > widgets/mycustomwidget.h
> > 
> > gets transformed into
> > 
> > widgets.mycustomwidget
> > 
> > I think you can't get much better than this, except maybe provide a way
> > to override this with a custom module path (like -m
> > mycustomwidget.module). However that is beyond my scope for now.
> > 
> > Phil, maybe you can put this into the next snapshot of PyQt4 so I don't
> > have to patch myself.
> I'm kind of in a general rush right now since I'm moving back to Germany right
> now.

That's kind of what I was thinking as you "vanished" from this list
around mid december.

> The patch should be okay for now.

I only write this to confirm that the python code generated with the
patched pyuic4 actually works and a widget using the ui is displaying
everything correct. 

I hope Phil includes it in the next snapshot (it wasn't in tonights).

Regarding the "for now": I guess you mean the manual inclusion of
QObject as base class when the extends element is empty. That is a ugly
hack indeed, but actually I didn't want to dive into the depth of pyuic4
to find out why it needs a QObject or QWidget there. Especially as this
base class is not used anywhere, i.e. the ui-class is derived from
python "object" and nothing else.


You have an unusual understanding of the problems of human relationships.

More information about the PyQt mailing list