Thu 28 Feb 2013 11:20:53 AM UTC, comment #2:
This has been fixed in commit 412f740.
Some technical explanation (because similar problems may lurk
around).
The button clicked signal can send an optional bool argument to
the slot function it connects to. Therefore you can do
b.clicked.connect(function_without_arg)
b.clicked[bool].connect(function_with_bool_arg)
Now in some cases we connect a function having an optional (non-bool) argument. We want this to be used as function
without argument, so the first syntax is used.
The first syntax is supposed to do default connection (I did not find a way to force 'without argument').
So I guess that
- PySide notes that the argument in the connected function is optional, and therefore uses the without_argument version,
- PyQt4 notes there is an argument, and therefore connects the version with_bool_arg
Both are legitimate choices: there is no way, and no need, to detect type of expected arguments in Python, as there is in the underlying Qt4 C++ libraries. But I like the PySide choice better, because we can explicitely link to the clicked[bool] signal if we want the bool argument to be passed.
To solve the different behavior, I added a function decorator
(stripFirstArg) that strips the bool argument off the connected function. The decorator is only applied when not using PySide.
|