Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.12.0
-
None
Description
If an ObjectModel used by one Repeater, reused by another Repeater (and released by the first one) then the model's items kept in an invalid state.
Closer to the code:
- QQmlObjectModel::object() emits initItem() on the refs count increased to 1.
- Subsequent references to the same model doesn't trigger initItem(), so other views/repeaters do not setup the items.
- On the first view/repeater released the items they are kept in an invalid state as there is no initItem() call.
There are two examples in the attachment.
- repeater-obj-model demonstrates the issue with QtQuick components (a red rectangle become unparented though it should not; the model setup is artificial)
- repeater-obj-model-with-controls demonstrates the issue on a stripped "real world" usage example (List with two actions. A CheckBox of the first action become unparented (and thus invisible) on the second action added).