aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickview/data
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-06-01 10:48:00 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2017-06-02 12:48:16 +0000
commitaf6655885cf19de69d5f57ac9daee9f6b9935a70 (patch)
tree1bd1212a370ec56507dce32624ee3a9d4d472569 /tests/auto/quick/qquickview/data
parentac02a71a9cb8e80014218ba7de46f4f914b6e00c (diff)
QQuickWindow/View: set a QObject-parent on the root item
People are often confused why eg. the objects from: window->contentItem()->findChildren() are not included in window->findChildren(). This change connects the item tree to the window's object tree to make findChild() and findChildren() produce expected results. The same technique is already used for QQuickFlickable's contentItem. [ChangeLog][QtQuick][QQuickWindow] Set the window as the QObject-parent of the contentItem to ensure consistent behavior for calling findChildren() on QQuickWindow and QQuickWindow::contentItem. [ChangeLog][QtQuick][QQuickView] Set the window's contentItem as the QObject-parent of the rootObject to ensure consistent behavior for calling findChildren() on QQuickWindow::contentItem and QQuickView::rootObject. Change-Id: Idb7834eb5e560088ca849e6ce90e6fa3b3ae3e91 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/quick/qquickview/data')
-rw-r--r--tests/auto/quick/qquickview/data/findChild.qml9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickview/data/findChild.qml b/tests/auto/quick/qquickview/data/findChild.qml
new file mode 100644
index 0000000000..8cbc46abe2
--- /dev/null
+++ b/tests/auto/quick/qquickview/data/findChild.qml
@@ -0,0 +1,9 @@
+import QtQuick 2.0
+Item {
+ width: 200
+ height: 200
+ objectName: "rootObject"
+ Item {
+ objectName: "rootObjectChild"
+ }
+}