diff options
Diffstat (limited to 'src/quicktemplates2/qquickstackview_p.cpp')
-rw-r--r-- | src/quicktemplates2/qquickstackview_p.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickstackview_p.cpp b/src/quicktemplates2/qquickstackview_p.cpp index ad08df5a..2657695d 100644 --- a/src/quicktemplates2/qquickstackview_p.cpp +++ b/src/quicktemplates2/qquickstackview_p.cpp @@ -137,6 +137,16 @@ bool QQuickStackElement::load(QQuickStackView *parent) if (!item) { ownItem = true; + if (component->isLoading()) { + QObject::connect(component, &QQmlComponent::statusChanged, [this](QQmlComponent::Status status) { + if (status == QQmlComponent::Ready) + load(view); + else if (status == QQmlComponent::Error) + qWarning() << qPrintable(component->errorString().trimmed()); + }); + return true; + } + QQmlContext *creationContext = component->creationContext(); if (!creationContext) creationContext = qmlContext(parent); |