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 68 - QSignalMapping lacks setMapping method
: QSignalMapping lacks setMapping method
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: QtCore
: HEAD
: PC Linux
: P5 normal
Assigned To: Hugo Parente Lima
:
:
:
  Show dependency treegraph
 
Reported: 2009-09-22 18:04 EEST by David Erosa García
Modified: 2009-10-14 14:18 EEST (History)
6 users (show)

See Also:


Attachments
Example of lack of setMapping (2.86 KB, text/x-python)
2009-09-22 18:04 EEST, David Erosa García
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Erosa García 2009-09-22 18:04:30 EEST
Created attachment 18 [details]
Example of lack of setMapping

Qt4 provides the QSignalMapping::setMapping method that works fine with PyQt4,
but PySide lacks that method and uses setMappingBy{Id, Object, String}. This
breaks backward compatibility. I attached a test-case from a previous working
PyQt4 code that returns the following error:

Traceback (most recent call last):
  File "productcontroller-pyside.py", line 81, in nuevo_boton
    self.signalMapper.setMapping(boton, boton.text())
AttributeError: 'QSignalMapper' object has no attribute 'setMapping'

The documentation in 

http://www.pyside.org/docs/pyside/PySide/QtCore/QSignalMapper.html 

is unclear about this, as the API has no reference to setMapping, but to the
methods I menctioned before, and the example provided in the documentation
refers to setMapping:

...
self.connect(SIGNAL("clicked()"), self.signalMapper, SLOT("map()"))
self.signalMapper.setMapping(button, text)
...

I compiled Pyside from source code using git:

git://gitorious.org/pyside/pyside.git
Comment 1 Hugo Parente Lima 2009-09-22 18:36:51 EEST
For some unknown reason the setMapping functions were renamed in the typesystem
to:

setMappingById
setMappingByString
setMappingByObject

The same happens with "mapping" and "mapped" methods. I'll check if these
methods were renamed as a workaround of this is was just inherited from
QtJambi/QtScriptGenerator
Comment 2 Hugo Parente Lima 2009-09-22 19:03:36 EEST
Fixed, just waiting to be merged into mainline.
Comment 3 Hugo Parente Lima 2009-09-22 19:07:35 EEST
merge request url:
http://qt.gitorious.org/pyside/pyside/merge_requests/1582