Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
5.11.2
-
None
Description
I am able to connect the signal QPushButton.clicked to callbacks with the following signatures:
callback() callback(x) callback(x=None) callback(x, y=None)
However only the first three work correctly; in the last case, emitting `clicked` causes an error:
TypeError: callback() takes at least 1 argument (0 given)
I have attached an example script that generates this error for me.
It seems that the optional `y` argument causes the wrong signal overload to be connected (since clicked has both [void] and [bool] overloads). I encountered this while migrating a large application from PyQt to PySide2, and I am left wondering whether I should wait for this to be fixed, or if this is the intended behavior and I should attempt to correct the application code?
Might also be nice to have an explanation of how overloads are automatically selected at https://wiki.qt.io/Qt_for_Python_Signals_and_Slots.