From b6cfb4a1e30598a6176f9bbfdbd1495b37c7f59a Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sat, 1 Oct 2016 20:04:16 +0200 Subject: StackView: allow loading remote URLs Task-number: QTBUG-55749 Change-Id: I369e0113492547f312c8f1b540f5faa506a75a25 Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickstackview_p.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/quicktemplates2/qquickstackview_p.cpp b/src/quicktemplates2/qquickstackview_p.cpp index 3709b988..050bfde9 100644 --- a/src/quicktemplates2/qquickstackview_p.cpp +++ b/src/quicktemplates2/qquickstackview_p.cpp @@ -138,6 +138,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); -- cgit v1.2.3