[PyKDE] KDE app template: Qt signal problem...

Jim Bublitz jbublitz at nwinternet.com
Thu Apr 28 08:57:16 BST 2005


On Wednesday 27 April 2005 23:36, Simon Edwards wrote:
> On Tuesday 26 April 2005 23:15, Jim Bublitz wrote:
> > In testapp.py, KParts want to reside in a KParts.MainWindow, not a
> > KMainWindow.  That means you'd need to provide an argument to createGUI
> > as well, which would be the part being displayed in the main window.
> >
> > Also, self._html is a KParts.ReadOnlyPart, which doesn't offer the
> > signals you're trying to connect to. You should be able specify the class
> > type in
>
> the
>
> > createReadOnlyPart call (rather than using the default), or else try
>
> sip.cast
>
> > to cast it to the type that offers the signals you want (not sure what
>
> you're
>
> > going for here).
>
> I seem to have the signal problems sorted out. But nothing is displayed in
> the window (need KParts.MainWindow?), which doesn't make sense since the
> code is based on the C++ app generated by KDevelop. It works and doesn't
> use KParts.MainWindow. Using KHTMLPart directly works though.

I don't recall for certain, but I think the KParts.MainWindow stuff may only 
affect the menu-merging when using a KPart, but don't trust me on that. David 
might know more about the KParts stuff ...

I should probably go back through the KParts stuff again and make sure what 
PyKDE does still makes sense (and document it better).

> I updated the code at:
>
> http://www.simonzone.com/software/python/kdeapp.tar.bz2

I'll take another look - tomorrow hopefully.

> Also, you can't do multiple inheritence with PyQt/PyKDE which makes it a
> bit hard to add the DCOP interface to testapp in the same way as in the C++
> version. But I've got a cunning plan to fix that. ;)

examples/example_dcopexport.py is one way to do that. You should be able to 
export anything using a subclass of DCOPExObj (which is a subclass of DCOPObj 
defined in the dcopexport module) to define the exported methods - they just 
have to be reachable from the subclass and could even be plain old Python 
functions not part of any class.

Jim




More information about the PyQt mailing list