Details
Description
Reusing the sample program from issue 2121 and writing
QMetaObject.invokeMethod(self, "setText", connection_type, Q_ARG(QObject, QLabel("Status")))
I get
$ python pysideXXX.py Python 3.10.8 Qt 6.4.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 12.2.0) [limited API] Window.__init__: MainThread asynch: Thread-1 (asynch) Window.setStatus: Thread-1 (asynch) Invoking using ConnectionType.BlockingQueuedConnection Window.setText: MainThread Traceback (most recent call last): File "/home/wolfgang/lib/python/qtgl/test/pysideXXX.py", line 27, in setText self.__statusLabel.setText(obj.text()) RuntimeError: Internal C++ object (PySide6.QtWidgets.QLabel) already deleted.
which means that the QLabel is already gone. Defining the QLabel as a variable and re-using it inside of invokeMethod resolves the isssue.
Attachments
Issue Links
- relates to
-
PYSIDE-2201 Segfault when calling signal of temporary
- Closed