aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickloader_p.h
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2017-12-15 13:26:28 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2018-02-02 07:14:53 +0000
commit4b014effe1f27407f5073ba738498ce87b918b9d (patch)
tree79d85bbd05fc4122b4bfc2ef407342edacebc77f /src/quick/items/qquickloader_p.h
parent7bd5d93899ca6c2175d6937f2011428c654bff02 (diff)
If Loader loads Window, set its transient parent to the Loader's window
This makes the Item { Loader { sourceComponent: Window { } } } case consistent with the Item { Window { } } case: the inner Window is transient for the outer Window. It works even if the Loader's Window has a visible: true declaration: in that case, until now, the Loader's Window would become visible at component creation time, before the outer Item became visible. So the test to check whether it had a transient parent did not work. We now change the delayed-visibility mechanism in QQuickWindowQmlImpl to wait for the parent Item to acquire a window of its own rather than waiting for the transient-parent-if-any to become visible. It should still take care of all the old cases too, e.g. in the Window { Window { } } case, the inner Window's QObject parent is actually the QQuickRootItem. (Amends 701255c76f671f100338a799f0194bf10e26c9d1) [ChangeLog][QtQuick][QQuickWindow] When a Window is declared inside another Item or Window, the window will not be created until the parent window is created. This allows it to have the correct transientParent and be managed as a transient window. Task-number: QTBUG-52944 Change-Id: Iaf4aafbd696f6e8dd0eec1d02db8bd181483bd07 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/items/qquickloader_p.h')
-rw-r--r--src/quick/items/qquickloader_p.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/quick/items/qquickloader_p.h b/src/quick/items/qquickloader_p.h
index db171dcd1e..8f0a9980b9 100644
--- a/src/quick/items/qquickloader_p.h
+++ b/src/quick/items/qquickloader_p.h
@@ -107,6 +107,7 @@ Q_SIGNALS:
protected:
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) Q_DECL_OVERRIDE;
void componentComplete() Q_DECL_OVERRIDE;
+ void itemChange(ItemChange change, const ItemChangeData &value) override;
private:
void setSource(const QUrl &sourceUrl, bool needsClear);