give fullrepresentation a parent immediately

like compactRepresentationItem, initialize it
with the appletInterface as parent at creation
not having any moment without parents
This commit is contained in:
Marco Martin 2015-06-18 18:27:49 -07:00
parent 2dbeea4d23
commit b2b1c93fac

View File

@ -210,7 +210,9 @@ QQuickItem *AppletQuickItemPrivate::createFullRepresentationItem()
}
if (fullRepresentation && fullRepresentation != qmlObject->mainComponent()) {
fullRepresentationItem = qobject_cast<QQuickItem*>(qmlObject->createObjectFromComponent(fullRepresentation, QtQml::qmlContext(qmlObject->rootObject())));
QVariantHash initialProperties;
initialProperties["parent"] = QVariant::fromValue(q);
fullRepresentationItem = qobject_cast<QQuickItem*>(qmlObject->createObjectFromComponent(fullRepresentation, QtQml::qmlContext(qmlObject->rootObject()), initialProperties));
} else {
fullRepresentation = qmlObject->mainComponent();
fullRepresentationItem = qobject_cast<QQuickItem*>(qmlObject->rootObject());