[PyQt] pyqtSlot decorator

Jonathan Mizrahi mizrahi.jonathan at gmail.com
Thu Sep 24 14:10:29 BST 2015


The documentation on the pyqtSlot decorator here
<http://pyqt.sourceforge.net/Docs/PyQt4/new_style_signals_slots.html#the-pyqtslot-decorator>
includes the somewhat cryptic statement:

"Although PyQt4 allows any Python callable to be used as a slot when
connecting signals, it is sometimes necessary to explicitly mark a Python
method as being a Qt slot."

When, exactly, is it necessary to use the @pyqtSlot decorator? Also, if a
signal calls a slot which has previously been garbage-collected, will that
cause problems in the program? My own simple tests seemed to show that
deleting slots, even pure Python slots which are not decorated, did not
cause a problem. But, are there cases where it does?

Thanks,
Jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150924/871cd0f1/attachment.html>


More information about the PyQt mailing list