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 12 - Support connecting C++ slots as python callback notation
: Support connecting C++ slots as python callback notation
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: QtCore
: HEAD
: All All
: P2 major
Assigned To: Lauro Moura
:
:
:
  Show dependency treegraph
 
Reported: 2009-08-21 14:41 EEST by Luciano Wolf
Modified: 2009-11-24 15:25 EET (History)
6 users (show)

See Also:


Attachments
Patch for screenshot.py example (1.60 KB, patch)
2009-08-25 13:36 EEST, Thulio Costa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luciano Wolf 2009-08-21 14:41:15 EEST
The screenshot.py examples crashes when it tries to execute the line:

self.quitScreenshotButton = self.createButton(self.tr("Quit"), self.close)
Comment 1 Thulio Costa 2009-08-25 13:36:21 EEST
Created attachment 11 [details]
Patch for screenshot.py example

This patch fixes the bug by modifying createButton method.
Now this function receives the button text, an object reference and a
function/method to be connected to the "clicked()" signal.

It's not perfect, but the example works with this.
Comment 2 Hugo Parente Lima 2009-08-25 13:44:05 EEST
This is a pyside bug, the original example *should* work without these
workarounds.
Comment 3 renato filho 2009-09-08 18:57:28 EEST
fixed on PySide commit: 574aa69173230fde2fa04c30e1f32d06c9098f56
Comment 4 Hugo Parente Lima 2009-09-25 10:54:21 EEST
The bug remains.

If you conenct a signal to a C++ slots usign the callback notation, the
callback gets called without any arguments.

To see the problem:

- run pyside-examples/examples/graphicsview/padnavigator example
- hit enter
- change the slider or the spinbox and watch the errors on the console.
Comment 5 renato filho 2009-10-21 17:55:59 EEST
Fixed on pyside commit: 95976f50b1424214da10a23586f629a09e239d1f
Comment 6 Lauro Moura 2009-10-28 19:32:01 EET
The fix introduced some regressions on existing signal tests.

Reopening and taking the bug.
Comment 7 Lauro Moura 2009-10-28 22:25:50 EET
I uploaded some initial fixes to my personal repo[1]

The fix removes the "unbounding" that happened during connection of bound
methods, as they can be called like normal functions.

Initially it worked but the sender test started to fail, due to some strange
behavior that provided a different "self" to the callback other than one in the
bound method.

Could this behavior happen due to the way the smart pointers & cia are created?

[1] http://qt.gitorious.org/~lauromoura/pyside/lauromoura-pyside/commits/bug12
Comment 8 Lauro Moura 2009-10-29 17:53:59 EET
Changing title. Was: self.close on screenshot.py doesn't work
Comment 9 Lauro Moura 2009-10-29 18:29:05 EET
My changes back to using bound methods creates problems as the trigger isn't
deleted, leading to some cases of cyclic dependency.
Comment 10 renato filho 2009-11-17 14:44:50 EET
fixed on previous commit.
Comment 11 renato filho 2009-11-24 15:25:08 EET
Fixed on PySide release 0.2.2