Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.2.1
-
None
Description
When using delegates with "required" properties, instead of relying on context properties, and a property is a QML type, the property is null if the propert type is used. If one uses "var", the property will be set correctly:
component TestItem : QtObject { } Component { id: component TestItem { property string text: "hello!!" } } ListView { id: list anchors.fill: parent delegate: Text { // if type is changed to 'var', it works!! Otherwise 'item' stays null!? required property TestItem item text: item.text height: 100 } model: ListModel { id: testModel } Component.onCompleted: { testModel.append({ item: component.createObject(null, {}) }) } }