diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-10-01 20:04:16 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-10-03 08:22:16 +0000 |
commit | b6cfb4a1e30598a6176f9bbfdbd1495b37c7f59a (patch) | |
tree | 9be9a272cc1395123fb53fa31d16981570653aae /src/quicktemplates2/qquickstackview_p.cpp | |
parent | 84d8f07b6d3133dc10a83f0b64c39a5948334302 (diff) |
StackView: allow loading remote URLs
Task-number: QTBUG-55749
Change-Id: I369e0113492547f312c8f1b540f5faa506a75a25
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
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 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); |