diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp index 14c8aff660d..d0f60103ae8 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp @@ -814,14 +814,8 @@ QObject *ObjectNodeInstance::parent() const QObject *ObjectNodeInstance::parentObject(QObject *object) { QQuickItem *quickItem = qobject_cast(object); - if (quickItem && quickItem->parentItem()) { - - //QQuickRootItem is used by Window and we want to return the Window as parent - if (strcmp(quickItem->metaObject()->className(), "QQuickRootItem")) - return object->parent(); - + if (quickItem && quickItem->parentItem()) return quickItem->parentItem(); - } return object->parent(); }