diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2015-01-15 16:05:26 +0100 |
---|---|---|
committer | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2015-01-16 15:01:31 +0100 |
commit | a704040dc4dd312e6d0552e6d9e6715f988ea39a (patch) | |
tree | b82a73ae61160ea2bb82089c0e63a6e9c6cd17ec /tests/auto/qml/qqmlcomponent/data/createQmlObject.qml | |
parent | 4426aa4055f75621f2b884a4ed5ab224ab0632da (diff) |
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 <simon.hausmann@digia.com>
Diffstat (limited to 'tests/auto/qml/qqmlcomponent/data/createQmlObject.qml')
-rw-r--r-- | tests/auto/qml/qqmlcomponent/data/createQmlObject.qml | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlcomponent/data/createQmlObject.qml b/tests/auto/qml/qqmlcomponent/data/createQmlObject.qml new file mode 100644 index 0000000000..282ab509f0 --- /dev/null +++ b/tests/auto/qml/qqmlcomponent/data/createQmlObject.qml @@ -0,0 +1,32 @@ +import QtQuick 2.0 +import QtQuick.Window 2.0 + +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.onCompleted: { + qtobject_qtobject = Qt.createQmlObject("import QtQuick 2.0; QtObject{}", qtobjectParent); + qtobject_item = Qt.createQmlObject("import QtQuick 2.0; Item{}", qtobjectParent); + qtobject_window = Qt.createQmlObject("import QtQuick.Window 2.0; Window{}", qtobjectParent); + item_qtobject = Qt.createQmlObject("import QtQuick 2.0; QtObject{}", itemParent); + item_item = Qt.createQmlObject("import QtQuick 2.0; Item{}", itemParent); + item_window = Qt.createQmlObject("import QtQuick.Window 2.0; Window{}", itemParent); + window_qtobject = Qt.createQmlObject("import QtQuick 2.0; QtObject{}", windowParent); + window_item = Qt.createQmlObject("import QtQuick 2.0; Item{}", windowParent); + window_window = Qt.createQmlObject("import QtQuick.Window 2.0; Window{}", windowParent); + } +} |