Details
Description
The following code used to work up in PySide < 6.8
{{connection = QObject.connect(instance, }}
{{ SIGNAL('valueChanged(int)'), }}
{{ instance, }}
{{ SLOT('my_slot_int(int)'), }}
Qt.ConnectionType.DirectConnection)
# do some stuff
b = instance.valueChanged.disconnect(instance.my_slot_int)
Starting from pyside 6.8 , the disconnection no longer works :
c:\d\work\pyqt-stubs\PySide6-stubs\tests\bug_pyside6.py:39: RuntimeWarning: Failed to disconnect (<bound method SomeClassWithSignal.my_slot_int of <_main_.SomeClassWithSignal(0x233eae2a720) at 0x00000233EC90E480>>) from signal "valueChanged(int)".
b = instance.valueChanged.disconnect(instance.my_slot_int)
Traceback (most recent call last):
File "c:\d\work\pyqt-stubs\PySide6-stubs\tests\bug_pyside6.py", line 40, in <module>
assert b
^
AssertionError
See full example in the attached file