diff options
author | Aleix Pol <aleixpol@kde.org> | 2021-09-21 00:10:26 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-09-30 10:29:36 +0000 |
commit | dbb123217e26e1e099371cd7e28fb4999059f31b (patch) | |
tree | 200ec60e86420ad3ade83d504369a52e32551a5a /src/quick/items | |
parent | bcce8187542d45b8986bd53cda3827d46badb82d (diff) |
QQuickLoader: Do not incubate if the source arrives after setActive(false)
Otherwise we end up in the crazy place of active being false but item
being non-null and forces us to workaround within the apps.
Change-Id: I88c27c4b00ccec8b8e0c05a8e10b44fcabfc2e30
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit e78c068700fa74ab3aca6a23ab2450563b1c3a5c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/quick/items')
-rw-r--r-- | src/quick/items/qquickloader.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/quick/items/qquickloader.cpp b/src/quick/items/qquickloader.cpp index d2f083e295..88f8af81d2 100644 --- a/src/quick/items/qquickloader.cpp +++ b/src/quick/items/qquickloader.cpp @@ -737,6 +737,9 @@ void QQuickLoaderPrivate::_q_sourceLoaded() return; } + if (!active) + return; + QQmlContext *creationContext = component->creationContext(); if (!creationContext) creationContext = qmlContext(q); itemContext = new QQmlContext(creationContext); |