[PySide] New Style Signal/Slot

Aaron Richiger a.richi at bluewin.ch
Tue Jul 17 14:54:16 CEST 2012


Hello Tim, me again... I just changed your code to make it working. It's 
shorter and therefore cleaner to understand but less interactive:-)! The 
key point is, that you have to define your signal in a subclass of 
QObject. The rest is mainly the same as you coded before...

#######################################

from PySide.QtCore import *

def someSlot():
     print 'test slot called'

class TestSignal(QObject):
     someSignal = Signal()

t = TestSignal()
t.someSignal.connect(someSlot)



More information about the PySide mailing list