QtCore.QObject.connect(my_button, QtCore.SIGNAL('clicked()'), my_func)
The first option is the old-style signal and slot syntax, which is now obsolete. You can still use it in PyQt4, but it is not supported at all in PyQt5. The second option is the new-style signal and slot syntax, which can be used in PyQt5 and all recent versions of PyQt4 (it was introduced in v4.5).
The PyQt docs lists the following disadvantages of the old-style syntax:
- It requires knowledge of the C++ types of signal arguments.
- It is error prone in that if you mis-type the signal name or signature - then no exception is raised, either when the signal is connected or emitted.
- It is verbose.
- It is not Pythonic.