[PySide] New Style Signal/Slot
Tim Doty
thoromyr at mac.com
Tue Jul 17 14:25:35 CEST 2012
I started with PyQt and the old style slot/signal method. I'm wanting to "do things right" and this would apparently include new style slot/signals, but I can't get it to work. For example, a signal object does not have connect() method.
import PySide.QtCore
@PySide.QtCore.Slot()
def someSlot():
pass
someSignal = PySide.QtCore.Signal()
someSignal.connect(someSlot)
results in:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'PySide.QtCore.Signal' object has no attribute 'connect'
Which would appear to be at odds with http://www.pyside.org/docs/pyside/PySide/QtCore/Signal.html
There is documentation for PyQt and signals/slots which I tried to follow, but I couldn't find the equivalent for PySide.
I'm assuming that I'm missing something obvious, but I can't see it.
Tim Doty
More information about the PySide
mailing list