forked from qt-creator/qt-creator
QmlDesigner:Instances: Adding instance for QQuickWindow
This allows QuickWindowNodeInstance to return the content item instead. The function parentObject() in ObjectNodeInstance now knows QQuickRootItem, because the parent of the root item should is the windows (which is just a QObject but treated as item from us). Change-Id: Ibaa7ccc8dd9346689cc4443ce0b594056feaa0cf Reviewed-by: Marco Bubke <marco.bubke@digia.com> Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
@@ -1124,8 +1124,14 @@ QObject *ObjectNodeInstance::parent() const
|
||||
QObject *parentObject(QObject *object)
|
||||
{
|
||||
QQuickItem *quickItem = qobject_cast<QQuickItem*>(object);
|
||||
if (quickItem)
|
||||
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();
|
||||
|
||||
return quickItem->parentItem();
|
||||
}
|
||||
|
||||
return object->parent();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user