[PyKDE] KPart problem

Jim Bublitz jbublitz at nwinternet.com
Mon Jul 25 20:29:00 BST 2005


On Sunday 24 July 2005 20:12, Roberto Alsina wrote:
> >   factory = kdecore.KLibLoader.self().factory( "libkonsolepart" );
> >   p=factory.create( win)
> >
> > with
> >
> >   p = kparts.createReadWritePart("libkonsolepart", win, "konsole",
> >                                  "KParts::Part")
> >
> > The syntax for this convenience function is
> >
> >   createReadWritePart(lib, parent, name, className, args)
> >
> > and I think I've chosen the correct library and class names for your
> > example.
>
> Well, that works fine and I get a terminal, but I run into another problem.
>
> To use the TerminalInterface-specific functionality, you need a
> TerminalInterface like this:
>
> TerminalInterface* t = static_cast<TerminalInterface*>( p->qt_cast(
> "TerminalInterface" ) );

If TerminalInterface has Python bindings, sip.cast () might work. If it has a 
DCOP interface, that might also work.
>
> And  I am, of course, getting a kparts.KParts.ReadWritePart

There is a createReadOnlyPart function with identical syntax. It's documented
at PyKDE/doc/classref/kparts/kparts-globals.html

> Is there a way to recast it from the python side of things, or is it a
> problem on the PyKDE side?

Sorry for the late reply - I was wandering in the wilderness for a few days 
and had the computers shut down. When I got home last night, my main computer 
wouldn't boot - power supply problems - and the other computer didn't want to 
send mail.

Jim




More information about the PyQt mailing list