Details
-
Type:
Bug
-
Status: Reported
-
Priority:
P2: Important
-
Resolution: Unresolved
-
Affects Version/s: 6.2.1
-
Fix Version/s: None
-
Component/s: Quick: Core Declarative QML
-
Labels:None
-
Platform/s:
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, {}) }) } }