Bug: signal type overrides broken on PySide6.2.1.1
Describe the bug haven't figured out what yet... but it's all of the failures in this test
________________________________________________________________________________
Traceback (most recent call last):
File "/Users/talley/Dropbox (HMS)/Python/forks/superqt/src/superqt/sliders/_labeled.py", line 313, in _on_value_changed
if len(v) != len(self._handle_labels):
TypeError: object of type 'int' has no len()
that's in the RangeSlider, where value should be a tuple... so i wonder whether class inheritance has somehow been slightly altered
ok, looks like PySide6.2 did something fundamental with signal types. It used to be possible to override the type of a signal in a subclass. for example, this worked in PySide2 and Pyside6<6.2:
class MyWidget(QSlider):
valueChanged = Signal(tuple) # QSlider.valueChanged is usually an int, but we could change it
# valueChanged would be a tuple
in 6.2 however, it looks like that's no longer possible. if you look at the value emitted in 6.2, even if you do mywidget.valueChanged.emit((20, 30)), the actual emitted value will be 0 :/
I created an issue here ... but I suspect this may be a "will not fix", meaning we might be stuck with some rather unfortunate breaking API changes for the range slider
Got same bug on 6.2.1.1 . 6.2.0 works.
what happens if you specify Signal(object)?
I use object workaround for Enum in PartSeg
https://github.com/4DNucleome/PartSeg/blob/4451f4ce2a5e2861d90a69c0977354b19da6b2ce/package/PartSeg/common_gui/universal_gui_part.py#L31
https://github.com/4DNucleome/PartSeg/blob/4451f4ce2a5e2861d90a69c0977354b19da6b2ce/package/PartSeg/common_gui/universal_gui_part.py#L68
At this moment I do not remember error, but it was something similar.
EDIT: I read again linked issue and it looks like my response does not fit to topic. But I left it, maybe it will be helpful for someone.
closed by #51