Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
5.15.2
-
None
-
Lubuntu 20.04
Description
The minimal example that causes the crash follows:
from PySide2.QtCore import QObject, Signal as QtSignal from PySide2.QtWidgets import QWidget, QApplication class QLoggerObject(QObject): filter_updated = QtSignal() def __init__(self, parent: QObject = None): super(QLoggerObject, self).__init__() class QLogger(object): def __init__(self, name: str, parent: QWidget = None, ui: bool = True): self.name = name self.widget = QLoggerObject(parent) self.widget.filter_updated.connect(self.slot) def slot(self): print('Slot invoked') def __eq__(self, other): if isinstance(other, QLogger): return self.name == other.name if isinstance(other, str): return self.name == other return super().__eq__(other) if __name__ == '__main__': app = QApplication([]) l = QLogger('name')
when the line
self.widget.filter_updated.connect(self.slot)
is executed, the app crashes with error:
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
if the `_eq_` reimplementation is cancelled out, the script works fine.
NOTE: The exact same code, with PyQt5 works fine.
Attachments
Issue Links
- duplicates
-
PYSIDE-1422 Signal crashes when class defined __eq__
- Closed