Check if referenced objects are valid

This kills plus 96c8478aef two ReferenceErrors I'm seeing when using
ListItems inside VisualItemModels (in this case, there's no view and
visual parent attached on creation).

REVIEW:106937
This commit is contained in:
Sebastian Kügler 2012-10-25 14:47:16 +02:00
parent 3fb4a78ed5
commit ee7255b261

View File

@ -69,7 +69,7 @@ Item {
//is this to be used as section delegate?
property bool sectionDelegate: false
width: parent.width
width: parent ? parent.width : childrenRect.width
height: paddingItem.childrenRect.height + background.margins.top + background.margins.bottom
property int implicitHeight: paddingItem.childrenRect.height + background.margins.top + background.margins.bottom