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 210 - Can't connect generic callable objects as a slot
: Can't connect generic callable objects as a slot
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: QtCore
: HEAD
: All All
: P5 normal
Assigned To: Hugo Parente Lima
:
:
:
  Show dependency treegraph
 
Reported: 2010-04-08 15:02 EEST by Lauro Moura
Modified: 2010-05-04 18:43 EEST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lauro Moura 2010-04-08 15:02:17 EEST
Trying to connect a functools.partial to a signal gives "Invalid callback
object" message. The same happens to objects with __call__ methods.
Comment 1 Hugo Parente Lima 2010-04-08 15:36:04 EEST
Sample code from Stuart McNicholas:

from PySide import QtCore
import functools

def aslot(args=None):
  print "slot",args

app = QtCore.QCoreApplication([])

o = QtCore.QObject()

o.connect(o,QtCore.SIGNAL("ASignal"),functools.partial(aslot,"partial .."))
o.emit(QtCore.SIGNAL("ASignal"))
Comment 2 Hugo Parente Lima 2010-04-08 16:39:18 EEST
Fixed, waiting for code review.

http://qt.gitorious.org/pyside/pyside-shiboken/merge_requests/99
Comment 3 Hugo Parente Lima 2010-04-08 17:16:33 EEST
Fixed in commit pyside-shiboken/f8907f4e4ed306f07c28d285d2d46bd2b43ea19b