aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickstackelement.cpp
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@qt.io>2017-08-03 20:04:57 +0200
committerAlessandro Portale <alessandro.portale@qt.io>2017-08-07 09:47:03 +0000
commit63f2f55462f2f040cfe175ada8aa1e01168597fc (patch)
tree3ec066df7cdc50d041afc3ba099cafd55153be71 /src/quicktemplates2/qquickstackelement.cpp
parenta723ad813fbbaa3dc79f64c974fe011f805b2ef8 (diff)
StackView: Resolve relative urls in initialItem
Check whether a URL is relative and try to resolve that. Change-Id: I6b0f7bca2011356aca5071d20dbd270eb5d115bf Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickstackelement.cpp')
-rw-r--r--src/quicktemplates2/qquickstackelement.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickstackelement.cpp b/src/quicktemplates2/qquickstackelement.cpp
index a3bb840e..887d43af 100644
--- a/src/quicktemplates2/qquickstackelement.cpp
+++ b/src/quicktemplates2/qquickstackelement.cpp
@@ -130,6 +130,9 @@ QQuickStackElement *QQuickStackElement::fromString(const QString &str, QQuickSta
return nullptr;
}
+ if (url.isRelative())
+ url = qmlContext(view)->resolvedUrl(url);
+
QQuickStackElement *element = new QQuickStackElement;
element->component = new QQmlComponent(qmlEngine(view), url, view);
element->ownComponent = true;