Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
6.7.0
-
None
-
Windows 11 Pro 23H2 / build: 22631.3374
CPU: Intel Core i7-8750H
GPU: Intel UHD Graphics 630
RAM: 16 GB
Qt Version: 6.7.0 msvc2019_64
Description
The documentation to "append"
in: https://doc.qt.io/qt-6/qml-qtqml-models-objectmodel.html
has an example how to use it:
objectModel.append(objectComponent.createObject())
if you follow this, your app will most likely crash sooner or later, because the garbage collector will delete the created object.
Two options:
- the documentation is correct and "append" does some "magic" to have the garbage collector not delete the item. Then the "magic" is broken.
- the documentation is incomplete. In this case, please add a parent to the createObject in the example. There are two other examples for "get" and "insert" where the parent is also missing.