The following code worked fine up until v6.6.2. (I tested as far back as 6.4 and up to 6.6.1 and they all worked)
from PySide6.QtCore import QObject, Signal class Emitter(QObject): sig = Signal(int) class CallableObject(QObject): def __call__(self, x: int): print("emitting", locals()) emitter = Emitter() obj = CallableObject() emitter.sig.connect(obj) emitter.sig.emit(1)
as of v6.6.2 you now get an error on connection:
Traceback (most recent call last): File "/Users/talley/dev/self/superqt/x.py", line 16, in <module> emitter.sig.connect(obj) TypeError: 'PySide6.QtCore.QObject.connect' called with wrong argument types: PySide6.QtCore.QObject.connect(Emitter, str, CallableObject) Supported signatures: PySide6.QtCore.QObject.connect(PySide6.QtCore.QObject, Union[bytes, bytearray, memoryview], Union[bytes, bytearray, memoryview], PySide6.QtCore.Qt.ConnectionType = Instance(Qt.AutoConnection)) PySide6.QtCore.QObject.connect(Union[bytes, bytearray, memoryview], Callable, PySide6.QtCore.Qt.ConnectionType = Instance(Qt.AutoConnection)) PySide6.QtCore.QObject.connect(Union[bytes, bytearray, memoryview], PySide6.QtCore.QObject, Union[bytes, bytearray, memoryview], PySide6.QtCore.Qt.ConnectionType = Instance(Qt.AutoConnection)) PySide6.QtCore.QObject.connect(PySide6.QtCore.QObject, PySide6.QtCore.QMetaMethod, PySide6.QtCore.QObject, PySide6.QtCore.QMetaMethod, PySide6.QtCore.Qt.ConnectionType = Instance(Qt.AutoConnection)) PySide6.QtCore.QObject.connect(PySide6.QtCore.QObject, Union[bytes, bytearray, memoryview], PySide6.QtCore.QObject, Callable, PySide6.QtCore.Qt.ConnectionType = Instance(Qt.AutoConnection)) PySide6.QtCore.QObject.connect(PySide6.QtCore.QObject, Union[bytes, bytearray, memoryview], Callable, PySide6.QtCore.Qt.ConnectionType = Instance(Qt.AutoConnection)) PySide6.QtCore.QObject.connect(PySide6.QtCore.QObject, Union[bytes, bytearray, memoryview], PySide6.QtCore.QObject, Union[bytes, bytearray, memoryview], PySide6.QtCore.Qt.ConnectionType = Instance(Qt.AutoConnection))
- relates to
-
PYSIDE-2423 Signature of objects with __call__ method incorrectly inspected on signal connect
-
- Reported
-