[PyKDE] PyKDE update

Jim Bublitz jbublitz at nwinternet.com
Mon Sep 29 21:06:01 BST 2003


On Monday September 29 2003 10:38, David Boddie wrote:
> On Sun, 28 Sep 2003 22:38:39, Jim Bublitz wrote:
> > If anyone's urgently in need of the next PyKDE release, or
> > has any other input, please speak up. I can put totgether
> > another rc release (more like a snapshot) in a few days if
> > necessary.

> Is there any way to cast Python QObject instances to other
> objects from within Python? An equivalent to this, for
> example:

> KHTMLPart *part = (KHTMLPart *) parent();

No - but (if %ConvertToSubClassCode is done correctly in PyKDE) 
then if:

     parent = KHTMLPart ()
     someObject = QWidget (parent)
     part = someObject.parent ()

'part' should be a KHTMLPart instance in Python.

It should work for anything in the QObject hierarchy, which 
includes all QWidget descendants, and anything in QEvent. There 
are a dozen or so other class/subclass hierarchies I haven't 
provided code for but can if necessary.

Is there a case where it's not working?  (requires PyKDE-3.7-4 or 
3.8rc2 - not in earlier releases)

Jim




More information about the PyQt mailing list