[PyKDE] QAssistantClient and PyQt

Peter Kropf pkropf at legato.com
Wed Jun 4 19:03:01 BST 2003


I'm a bit confused about a problem that I'm having when using
QAssistantClient from a Python program. Here's a snippet of the code that
I'm using to test things out.

import sys
from qt import *

class LaunchButton( QPushButton ):
    def __init__( self, *args ):
        apply( QPushButton.__init__, (self,) + args )
        self.setText( "Launch" )


class TheWindow( QMainWindow ):
    def __init__( self, *args ):
        apply( QMainWindow.__init__, (self,) + args )

        self.button=LaunchButton( self )
        self.setCentralWidget( self.button )
        self.connect( self.button, SIGNAL( "clicked()" ), self.BeenClicked )

        self.qac = QAssistantClient( '' )
        self.connect( self.qac, SIGNAL( "destroyed()" ),
self.qacDestroyed )
        self.connect( self.qac, SIGNAL( "assistantOpened()" ),
self.qacOpened )
        self.connect( self.qac, SIGNAL( "assistantClosed()" ),
self.qacClosed )
        self.connect( self.qac, SIGNAL( "error()" ),           self.qacError
)

        self.toggle = True

    def qacDestroyed( self ):
        print 'qacDestroyed'

    def qacOpened( self ):
        print 'qacOpened'

    def qacClosed( self ):
        print 'qacClosed'

    def qacError( self ):
        print 'qacError'

    def BeenClicked( self ):
        if self.toggle:
            page = '/tools/qt/doc/html/assistant.html'
            self.toggle = False
        else:
            page = '/tools/qt/doc/html/assistant-4.html#3'
            self.toggle = True
        print 'Been clicked: ' + page
        self.qac.showPage( page )


def main(args):
    app=QApplication( args )

    win=TheWindow( )
    win.show( )

    app.connect( app, SIGNAL( "lastWindowClosed()" ), app, SLOT( "quit()" )
)
    app.exec_loop()


if __name__=="__main__":
    main( sys.argv )


My problem occurs when connecting the error signal to a slot. At runtime, I
receive these messages:

QObject::connect: No such signal QAssistantClient::error()
QObject::connect:  (sender name:   'unnamed')
QObject::connect:  (receiver name: 'unnamed')

But when I look through the QAssistantClient.cpp and
sipqtQAssistantClient.cpp code, the error signal looks to be defined the
same way the destroyed, assistantOpened and assistantClosed signals. What am
I missing?

Thanks.


- Peter

Special Projects Group, Legato Systems
3210 Porter Drive, Palo Alto, CA 94304
650-812-6081 Desk
408-482-9427 Cell
pkropf at legato.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20030604/592f81ff/attachment.html


More information about the PyQt mailing list