[review] [PyKDE] Using konsolepart. How?

Jim Bublitz jbublitz at nwinternet.com
Mon Sep 19 23:43:45 BST 2005


On Monday 19 September 2005 05:54, Russell Brown wrote:
> Hi,
>
> Firsly sorry for asking what's probably a numpty question (although I
> have looked through the archives and searched the docs/examples) but I'm
> new to Py{thon,KDE}.
>
> As a mini-project to learn PyKDE, I'm trying to produce a 'wrapper'
> around KDE konsolepart for access to a legacy app.  It'll end up with
> the konsole window in the middle and some special function
> buttons/widgets.
>
> I can fire up a konsolepart (using info gleaned from this list) but
> can't seem to make use of the signals within it.
>
> I am assuming that it will be possible to use receivedData() and
> slotReceivedData() to intercept the incoming datastream to konsole and
> 'do things' with it (like turning on a status bar or changing the font
> size to fit the window on screen when it goes into 132col mode).  A
> fragment of the troublesome code:
>
>     app.setMainWidget(win)
>     p = createReadOnlyPart("libkonsolepart", win, "konsole","KParts::Part")
>     win.setCentralWidget(p.widget())
>     p.connect(p, SIGNAL('receivedData(const QString& s)'), myfunc)
>
> This however generates an error:
>
> kdecore (KAction): WARNING: KActionCollection::KActionCollection(
> QObject *parent, const char *name, KInstance *instance )
> QObject::connect: No such signal konsolePart::receivedData(const
> QString&s)
> QObject::connect:  (sender name:   'konsole')
> QObject::connect:  (receiver name: 'unnamed')
>
> Am I trying to do something that isn't possible? or just doing it wrong?
>
> How do I specify that myfunc gets the string from receivedData() ?

I'd think you'd have to write bindings for konsolePart - PyKDE/Python don't 
know what a konsolePart object is or what signals it emits. They'd see it as 
KReadOnlyPart, which doesn't possess the signal you want.

Jim




More information about the PyQt mailing list