[PyQt] QPushbutton connect(no-arg) signal variant in 5.3?

David Cortesi davecortesi at gmail.com
Sat Sep 6 19:03:47 BST 2014


Python 3.3. Under version 5.2 the program below prints,

> PyQt 5.2 Qt 5.2.0
> slot got ()  # <-- when button is clicked

Under version 5.3, it prints

> PyQt 5.3 Qt 5.3.0
> 'there is no matching overloaded signal'

So it appears that the syntax "clicked[()].connect(slot)" to select the
no-arg signal, that worked in 5.2, somehow does not in 5.3. Apologies if
this is fixed in 5.3.1, however I don't see anything relevant in the 5.3.1
changelog.

Here is the quite simple test case:

> '''
> Test of QPushButton clicked() signal
> ''
> from PyQt5.QtCore import PYQT_VERSION_STR
> from PyQt5.QtCore import QT_VERSION_STR
> print('PyQt',PYQT_VERSION_STR,'Qt',QT_VERSION_STR)
>
> from PyQt5.QtWidgets import QApplication,QWidget,QPushButton
> def slot(*args):
>     print('slot got',args)
> the_app = QApplication([])
> widg = QWidget()
> pb = QPushButton(widg)
> try:
>     pb.clicked[()].connect(slot)
> except KeyError as k:
>     print(k)
>     exit()
> widg.show()
> the_app.exec_()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140906/7e08f5bb/attachment.html>


More information about the PyQt mailing list