[PyKDE] Using konsolepart. How?

Russell Brown russell at lls.lls.com
Mon Sep 19 13:54:42 BST 2005


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() ?

Thanks in advance.
-- 
 Regards,
     Russell
 --------------------------------------------------------------------
| Russell Brown          | MAIL: russell at lls.com PHONE: 01780 471800 |
| Lady Lodge Systems     | WWW Work: http://www.lls.com              |
| Peterborough, England  | WWW Play: http://www.ruffle.me.uk         |
 --------------------------------------------------------------------




More information about the PyQt mailing list