<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>QAssistantClient and PyQt</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>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.</FONT></P>
<P><FONT SIZE=2>import sys</FONT>
<BR><FONT SIZE=2>from qt import *</FONT>
</P>
<P><FONT SIZE=2>class LaunchButton( QPushButton ):</FONT>
<BR><FONT SIZE=2> def __init__( self, *args ):</FONT>
<BR><FONT SIZE=2> apply( QPushButton.__init__, (self,) + args )</FONT>
<BR><FONT SIZE=2> self.setText( "Launch" )</FONT>
</P>
<BR>
<P><FONT SIZE=2>class TheWindow( QMainWindow ):</FONT>
<BR><FONT SIZE=2> def __init__( self, *args ):</FONT>
<BR><FONT SIZE=2> apply( QMainWindow.__init__, (self,) + args )</FONT>
</P>
<P><FONT SIZE=2> self.button=LaunchButton( self )</FONT>
<BR><FONT SIZE=2> self.setCentralWidget( self.button )</FONT>
<BR><FONT SIZE=2> self.connect( self.button, SIGNAL( "clicked()" ), self.BeenClicked )</FONT>
</P>
<P><FONT SIZE=2> self.qac = QAssistantClient( '' )</FONT>
<BR><FONT SIZE=2> self.connect( self.qac, SIGNAL( "destroyed()" ), self.qacDestroyed )</FONT>
<BR><FONT SIZE=2> self.connect( self.qac, SIGNAL( "assistantOpened()" ), self.qacOpened )</FONT>
<BR><FONT SIZE=2> self.connect( self.qac, SIGNAL( "assistantClosed()" ), self.qacClosed )</FONT>
<BR><FONT SIZE=2> self.connect( self.qac, SIGNAL( "error()" ), self.qacError )</FONT>
</P>
<P><FONT SIZE=2> self.toggle = True</FONT>
</P>
<P><FONT SIZE=2> def qacDestroyed( self ):</FONT>
<BR><FONT SIZE=2> print 'qacDestroyed'</FONT>
</P>
<P><FONT SIZE=2> def qacOpened( self ):</FONT>
<BR><FONT SIZE=2> print 'qacOpened'</FONT>
</P>
<P><FONT SIZE=2> def qacClosed( self ):</FONT>
<BR><FONT SIZE=2> print 'qacClosed'</FONT>
</P>
<P><FONT SIZE=2> def qacError( self ):</FONT>
<BR><FONT SIZE=2> print 'qacError'</FONT>
</P>
<P><FONT SIZE=2> def BeenClicked( self ):</FONT>
<BR><FONT SIZE=2> if self.toggle:</FONT>
<BR><FONT SIZE=2> page = '/tools/qt/doc/html/assistant.html'</FONT>
<BR><FONT SIZE=2> self.toggle = False</FONT>
<BR><FONT SIZE=2> else:</FONT>
<BR><FONT SIZE=2> page = '/tools/qt/doc/html/assistant-4.html#3'</FONT>
<BR><FONT SIZE=2> self.toggle = True</FONT>
<BR><FONT SIZE=2> print 'Been clicked: ' + page</FONT>
<BR><FONT SIZE=2> self.qac.showPage( page )</FONT>
</P>
<BR>
<P><FONT SIZE=2>def main(args):</FONT>
<BR><FONT SIZE=2> app=QApplication( args )</FONT>
</P>
<P><FONT SIZE=2> win=TheWindow( )</FONT>
<BR><FONT SIZE=2> win.show( )</FONT>
</P>
<P><FONT SIZE=2> app.connect( app, SIGNAL( "lastWindowClosed()" ), app, SLOT( "quit()" ) )</FONT>
<BR><FONT SIZE=2> app.exec_loop()</FONT>
</P>
<BR>
<P><FONT SIZE=2>if __name__=="__main__":</FONT>
<BR><FONT SIZE=2> main( sys.argv )</FONT>
</P>
<BR>
<P><FONT SIZE=2>My problem occurs when connecting the error signal to a slot. At runtime, I receive these messages:</FONT>
</P>
<P><FONT SIZE=2>QObject::connect: No such signal QAssistantClient::error()</FONT>
<BR><FONT SIZE=2>QObject::connect: (sender name: 'unnamed')</FONT>
<BR><FONT SIZE=2>QObject::connect: (receiver name: 'unnamed')</FONT>
</P>
<P><FONT SIZE=2>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?</FONT></P>
<P><FONT SIZE=2>Thanks.</FONT>
</P>
<BR>
<P><FONT SIZE=2>- Peter</FONT>
</P>
<P><FONT SIZE=2>Special Projects Group, Legato Systems</FONT>
<BR><FONT SIZE=2>3210 Porter Drive, Palo Alto, CA 94304</FONT>
<BR><FONT SIZE=2>650-812-6081 Desk</FONT>
<BR><FONT SIZE=2>408-482-9427 Cell</FONT>
<BR><FONT SIZE=2>pkropf@legato.com</FONT>
</P>
</BODY>
</HTML>