Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
6.5.2
-
None
Description
When instantiating a QML element implemented in Python, the object lifetime is shorter than the object lifetime of QML elements defined in C++ or QML leading to `Cannot read property ... of null` errors on application exit.
I've attached 2 minimal examples, one using PySide6 and one using Qt/C++ to demonstrate the problem. The PySide6 example throws the error `main.qml:23: TypeError: Cannot read property 'foo' of null` on application exit, where the C++ application just works.
A workaround is to use defensive coding strategies e.g. nullish coalescing and optional chaining, but that adds unnecessary code compared to the C++ implementation.
Attachments
Issue Links
- relates to
-
PYSIDE-2193 Crash when returning non-QObject Python object to QML
-
- In Review
-