Thanks for suggestion, but that is not the intended use case, because in end application I want the child Items to be dynamic, so the parent needs to adjust its size using childrenRect. I simplified the example to the minimum for easy reproducing.
Anyway some more realistic use case, where objects are created dynamically and creates the same error/warning message.
Item {
width: 400
height: 400
Component {
id: dynamicRec
Rectangle {
border.color: "red"
width: parent.width
height: 20
}
}
Column {
id: subOptionList
property bool expanded: false
height: expanded ? childrenRect.height : 0
clip: true
width: parent.width
Component.onCompleted: {
dynamicRec.createObject(subOptionList,{});
dynamicRec.createObject(subOptionList,{});
dynamicRec.createObject(subOptionList,{});
}
}
MouseArea {
anchors.fill: parent
onClicked: {
subOptionList.expanded = !subOptionList.expanded
}
}
}
I really like QML so want to know if this could be a bug, so it can be reported and fixed :)
↧









