[Tutor] Re: Question on PyQt Signals and Slots

Lee Harr missive at hotmail.com
Fri Feb 20 11:35:55 EST 2004

>    I am building an application using python and Qt
>and would like to know how one should pass arguments
>when using Signals and Slots. Especially when one of
>the arguments is a class instance.
>These were my attempts that returned errors.
>def tableclick(self,a,b,c,d):
>def tableclick(self,*args):
>def tableclick(self,*args,**argv):
>def tableclick(self,a,b,c,d,*arg):
>RuntimeError: Signal has wrong argument types for slot

Sorry for the delay... it really helps if you post a complete example
that exhibits the behaviour you are experiencing. Here's one:

import sys
from qt import *
from qttable import *

numRows = 5
numCols = 5

class ATable(QTable):
    def tableclick(self, *args, **kw):
        print 'click', args, kw

if __name__ == '__main__':
    app = QApplication(sys.argv)

    table = ATable(numRows, numCols)

    QObject.connect(table, SIGNAL("clicked(int,int,int,QPoint)"), 
    #QObject.connect(table, SIGNAL("valueChanged(int,int)"), 


The second connector there -- the one commented out -- actually
works. Not sure yet why the clicked signal is not working. Maybe
this will help someone else help us along.

The new MSN 8: advanced junk mail protection and 2 months FREE* 

More information about the Tutor mailing list