Fix visual parent ownership with scenes that create windows
authorSimon Hausmann <simon.hausmann@digia.com>
Fri, 28 Mar 2014 17:41:26 +0000 (18:41 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 28 Mar 2014 22:02:34 +0000 (23:02 +0100)
commit8b371173c4fed7df453a0e352af54e3363709d4b
treec6b34db3954572b896fe6ac94d37bd68ba6f725a
parent9614dc2c51b54e32de7dac3543c3e044d0b3c240
Fix visual parent ownership with scenes that create windows

Commit 39540124dd0900e0c99dcda8c0ebdf4f3cea8d5e introduced the concept that
a visual parent marks its children, by recursively marking the children of
the root item in a QQuickView. This allowed for the removal of an ugly hack
in QtQuick Controls.

Unfortunately that fix is incomplete in the sense that it makes the incorrect
assumption that a QQuickView is always used. The use-case in the bug report is
to have child items inside a QtQuick.Window (a regular ApplicationWindow in
fact). That window - implemented by QQuickWindowQmlImpl - also needs to mark
its children, so this patch introduces the use of the same GC marking helper
class (which now operates on a QQuickWindow instead of a QQuickViewPrivate).

Task-number: QTBUG-37711
Change-Id: Id788e84dbb041ac8ba6ff23dc4ef56f6fe9e465a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/quick/items/qquickview.cpp
src/quick/items/qquickview_p.h
src/quick/items/qquickwindowmodule.cpp
tests/auto/quick/qquickitem/data/visualParentOwnershipWindow.qml [new file with mode: 0644]
tests/auto/quick/qquickitem/tst_qquickitem.cpp