From a704040dc4dd312e6d0552e6d9e6715f988ea39a Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Thu, 15 Jan 2015 16:05:26 +0100 Subject: Avoid an incorrect warning when dynamically parenting a Window "Created graphical object was not placed in the graphics scene." QQuickWindow is the root of a graphics scene and doesn't need to be inside another one. It is already suggested in the Window documentation that Window can be an inline child of a top-level QtObject. This patch fixer the warning when dynamically creating a Window component. Change-Id: Ie6d9d37b9e9ffdb61101aaaad6f4b722216ec759 Reviewed-by: Simon Hausmann --- tests/auto/qml/qqmlcomponent/data/createObject.qml | 38 +++++++++++++++++----- 1 file changed, 30 insertions(+), 8 deletions(-) (limited to 'tests/auto/qml/qqmlcomponent/data/createObject.qml') diff --git a/tests/auto/qml/qqmlcomponent/data/createObject.qml b/tests/auto/qml/qqmlcomponent/data/createObject.qml index da5db8e8e6..afd9e71229 100644 --- a/tests/auto/qml/qqmlcomponent/data/createObject.qml +++ b/tests/auto/qml/qqmlcomponent/data/createObject.qml @@ -1,13 +1,35 @@ import QtQuick 2.0 +import QtQuick.Window 2.0 -Item{ - id: root - property QtObject qobject : null - property QtObject declarativeitem : null - Component{id: a; QtObject{} } - Component{id: b; Item{} } +Item { + property QtObject qtobjectParent: QtObject { } + property QtObject itemParent: Item { } + property QtObject windowParent: Window { } + + property QtObject qtobject_qtobject : null + property QtObject qtobject_item : null + property QtObject qtobject_window : null + + property QtObject item_qtobject : null + property QtObject item_item : null + property QtObject item_window : null + + property QtObject window_qtobject : null + property QtObject window_item : null + property QtObject window_window : null + + Component { id: a; QtObject{} } + Component { id: b; Item{} } + Component { id: c; Window{} } Component.onCompleted: { - root.qobject = a.createObject(root); - root.declarativeitem = b.createObject(root); + qtobject_qtobject = a.createObject(qtobjectParent); + qtobject_item = b.createObject(qtobjectParent); + qtobject_window = c.createObject(qtobjectParent); + item_qtobject = a.createObject(itemParent); + item_item = b.createObject(itemParent); + item_window = c.createObject(itemParent); + window_qtobject = a.createObject(windowParent); + window_item = b.createObject(windowParent); + window_window = c.createObject(windowParent); } } -- cgit v1.2.3