immediately parent objects

don't let representations without parents, avoid
possible leaks and fix cases in which the applet relies
on ht eparent hyerarchy, such as ColorContext
This commit is contained in:
Marco Martin 2015-06-10 22:34:22 -07:00
parent eb4edb0e9e
commit c60ca1b6a0

View File

@ -187,7 +187,10 @@ QQuickItem *AppletQuickItemPrivate::createCompactRepresentationItem()
return compactRepresentationItem;
}
compactRepresentationItem = qobject_cast<QQuickItem*>(qmlObject->createObjectFromComponent(compactRepresentation, QtQml::qmlContext(qmlObject->rootObject())));
QVariantHash initialProperties;
initialProperties["parent"] = QVariant::fromValue(q);
compactRepresentationItem = qobject_cast<QQuickItem*>(qmlObject->createObjectFromComponent(compactRepresentation, QtQml::qmlContext(qmlObject->rootObject()), initialProperties));
emit q->compactRepresentationItemChanged(compactRepresentationItem);