Fix QML warning about not having parents

It seems that the ListView doesn't always set the parent element correctly if it's not yet in view. This is a workaround that seems to work fine to remove the QML warnings about parent not being defined.

Contributes to issue CURA-8561.
This commit is contained in:
Ghostkeeper 2021-11-09 15:54:42 +01:00
parent 2ce31d0e71
commit abe8347523
No known key found for this signature in database
GPG key ID: 68F39EA88EEED5FF

View file

@ -12,7 +12,7 @@ Rectangle
{
property var packageData
width: parent.width
width: parent ? parent.width : 0
height: childrenRect.height + UM.Theme.getSize("default_margin").height * 2
color: UM.Theme.getColor("main_background")