Hi,

Can I first say thanks to all who read my newb questions and helped me out, much appreciated.

Quick pyqt question:

mywindow has a button on it. I want to run the clicked_function when clicked. This works
Qt Code:
  1. QtCore.QObject.connect(mywindow.somebutton, QtCore.SIGNAL("clicked()"), clicked_function)
To copy to clipboard, switch view to plain text mode 


But if I want to click the button and pass 'foo' to the clicked_function, I thought I would be able to use
Qt Code:
  1. QtCore.QObject.connect(mywindow.somebutton, QtCore.SIGNAL("clicked()"), clicked_function('foo'))
To copy to clipboard, switch view to plain text mode 


This brings up an 'argument of incorrect type' error. So how can I pass a value to the function? I thought I might try...

Qt Code:
  1. QtCore.QObject.connect(mywindow.somebutton, QtCore.SIGNAL("clicked()"), pre_clicked_function)
  2.  
  3. def pre_clicked_function():
  4. clicked_function('foo')
To copy to clipboard, switch view to plain text mode 

But this is far from streamlined! Any better ideas?