PyQT signals with arguments

so , here a snippet on how to use the different types of signals in PyQt:

  • connect a signal from C++
    QObject.connect(self.sender, SIGNAL("signalName( Arg1TYPE, Arg2TYPE )"), self.slot)
  • connect a signal from Python
    QObject.connect(self.sender, SIGNAL("signalName" ), self.slot )
  • emit a signal in Python
    self.emit( SIGNAL( "signalName" ), arg1, arg2 )
  • emit a signal in c++
    emit signalName( arg1, arg2 );

more: http://www.eurion.net/python-snippets/snippet/Connecting%20signals%20and%20slots.html

Leave a Reply