[PyKDE] KXMLGUIFactory.container()

Gordon Tyler gordon at doxxx.net
Mon Apr 14 00:53:01 BST 2003


On April 13, 2003 04:55 pm, Phil Thompson wrote:
> > Okay, I'll give that a try. Does it matter where in the sip file I define
> > the %ConvertToSubClassCode block?
>
> It must be part of a class definition, but it doesn't matter which one. I
> use the "main" class of the module, ie. QObject for qt, QCanvas for
> qtcanvas, QTable for qttable etc.

I used KMainWindow as the "main" class for the kdeui module. I've attached a 
patch which fixes my particular situation. I'm not sure how it should be 
extended to the rest of PyKDE. I think I'll leave that one for Jim to figure 
out ;)

> > That's not the case here I think. The function is returning instances
> > managed by another class so Python doesn't need to call their destructor.
>
> Then I'm surprised, because the KDE docs talk of factory functions.

I may be misunderstanding the KDE docs and source code but it doesn't look 
like it's just creating an instance and then throwing it away, leaving the 
client to manage the lifetime of the instance. There's what appears to be a 
tree-like structure containing the various widgets created from the XML 
document. And the container function just finds a widget in that tree and 
returns it.

And my Python code does work now ;)

Thanks for all your help, Phil.

Ciao,
Gordon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PyKDE-3.5-2-subclass.patch
Type: text/x-diff
Size: 1013 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20030414/4dfd80d3/PyKDE-3.5-2-subclass.bin


More information about the PyQt mailing list