make the toolbox directly child of containmentinterface

This commit is contained in:
Marco Martin 2014-05-07 20:27:51 +02:00
parent a5dc443b1b
commit 53893e8d0b

View File

@ -124,13 +124,12 @@ void ContainmentInterface::init()
if (pkg.isValid()) {
QObject *containmentGraphicObject = qmlObject()->rootObject();
if (containmentGraphicObject) {
QVariantHash toolboxProperties;
toolboxProperties["parent"] = QVariant::fromValue(containmentGraphicObject);
QObject *toolBoxObject = qmlObject()->createObjectFromSource(QUrl::fromLocalFile(pkg.filePath("mainscript")), 0, toolboxProperties);
if (toolBoxObject) {
containmentGraphicObject->setProperty("toolBox", QVariant::fromValue(toolBoxObject));
}
QVariantHash toolboxProperties;
toolboxProperties["parent"] = QVariant::fromValue(this);
QObject *toolBoxObject = qmlObject()->createObjectFromSource(QUrl::fromLocalFile(pkg.filePath("mainscript")), 0, toolboxProperties);
if (toolBoxObject && containmentGraphicObject) {
containmentGraphicObject->setProperty("toolBox", QVariant::fromValue(toolBoxObject));
}
} else {
qWarning() << "Could not load toolbox package." << pkg.path();