Description
There is an issue in PySide2/Qt5 when using signals derived from mixin.
For example, the following code doesn't print "emit2". After calling mySignal.connect(), mySlot is never called.
import PySide2.QtCore as QtCore class Mixin(object): mySignal = QtCore.Signal() def __init__(self, *args, **kwargs): super(Mixin,self).__init__(*args, **kwargs) class Derived(Mixin, QtCore.QObject): echoSignal = QtCore.Signal(str) def __init__(self): super(Derived,self).__init__() self.echoSignal.connect(self.mySlot) def mySlot(self, v): print v + ' -> mySlot' def nopSlot(): pass obj = Derived() obj.echoSignal.emit('emit1') obj.mySignal.connect(nopSlot) # This line breaks mySlot.. obj.echoSignal.emit('emit2')
I suspect that this is caused by a change to sort slots and signals in dynamicqmetaobject.cpp. Probably someone is still using index from AddMethod()?
Attachments
For Gerrit Dashboard: PYSIDE-315 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
182483,2 | Fix “Fix Segfault when using connect” | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
182762,4 | Fix registration of signals and slots inherited from mixin classes | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
183253,16 | Warn if signals and slots are out of order | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
184567,2 | blacklist: static_metaobject_test.py works | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |