From b2b1c93face5e887071f6f3e012f85929efbb06c Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 18 Jun 2015 18:27:49 -0700 Subject: [PATCH] give fullrepresentation a parent immediately like compactRepresentationItem, initialize it with the appletInterface as parent at creation not having any moment without parents --- src/plasmaquick/appletquickitem.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plasmaquick/appletquickitem.cpp b/src/plasmaquick/appletquickitem.cpp index 8ec2278c0..efe861168 100644 --- a/src/plasmaquick/appletquickitem.cpp +++ b/src/plasmaquick/appletquickitem.cpp @@ -210,7 +210,9 @@ QQuickItem *AppletQuickItemPrivate::createFullRepresentationItem() } if (fullRepresentation && fullRepresentation != qmlObject->mainComponent()) { - fullRepresentationItem = qobject_cast(qmlObject->createObjectFromComponent(fullRepresentation, QtQml::qmlContext(qmlObject->rootObject()))); + QVariantHash initialProperties; + initialProperties["parent"] = QVariant::fromValue(q); + fullRepresentationItem = qobject_cast(qmlObject->createObjectFromComponent(fullRepresentation, QtQml::qmlContext(qmlObject->rootObject()), initialProperties)); } else { fullRepresentation = qmlObject->mainComponent(); fullRepresentationItem = qobject_cast(qmlObject->rootObject());