PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 542 - New style signals/slots + curried functions: unexpected argument during call
: New style signals/slots + curried functions: unexpected argument during call
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: PySide
: 1.0.0 beta1
: All All
: P2 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2010-12-11 14:49 EET by Christian Mayrhuber
Modified: 2010-12-20 11:26 EET (History)
8 users (show)

See Also:


Attachments
Example code to reproduce the problem (2.59 KB, application/octet-stream)
2010-12-11 14:49 EET, Christian Mayrhuber
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Mayrhuber 2010-12-11 14:49:55 EET
Created attachment 176 [details]
Example code to reproduce the problem

The test code creates a form of six buttons. Each click to a button sets the
label to a message which button was clicked. The clicked signals sent from
buttons One, Five and Six behave as expected (no argument in signal call). The
signals sent from the button Two, Three and Four contain an additional boolean
argument.

Behavior:
 - a click on button One, Five and Six set the label to "You clicked button
'BUTTON_NAME'" which is ok.
 - a click on button Two or Three sets the label prints "Additional arguments:
(False,)" to the console.
 - a click on button Four sets the label to "You clicked button 'False'"

Summary:
If the button's "clicked()" signal is sent to a slot which is comprised of
either a curried (partial) or lambda function then the slot is called with an
additional boolean argument.

The code in connections.pyw stems from the book Rapid GUI Programming with
Python and QT and was modified to use new style signals and slots.

===================

First analysis of Marcelo Lira:

The problem has to do with the way new style signals are connected. It
seems that when you use "button.clicked.connect" with lambda and
partials, the bindings are mistakingly connecting as if you had used
"button.clicked[bool].connect". It workds when connecting signals old
style: "QObject.connect(button, SIGNAL('clicked()'), ...)". But this
is ugly and old.
Comment 1 Matti Airas 2010-12-13 14:23:51 EET
Thanks for the bug report. I'm prioritizing this P2 because the bug is related
to the signals/slots semantics and has therefore potentially a wide impact.
This will be taken care of probably during our next sprint.
Comment 2 Marcelo Lira 2010-12-13 16:08:50 EET
Fixed in commit Shiboken/33537a0e.
Comment 3 Hugo Parente Lima 2010-12-20 11:26:15 EET
Closign bugs after release of 1.0.0 beta2.