aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcontext.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-02-07 16:22:53 +0100
committerUlf Hermann <ulf.hermann@qt.io>2020-03-17 14:44:26 +0100
commitf4937a21b61bf2f214d175d77c432c68f25ead21 (patch)
treea9753103192cf6310913ed3127bf48d80aed8462 /src/qml/qml/qqmlcontext.cpp
parent1eb20d70619cc896fc283bd6605b257a8750c518 (diff)
Allow multiple URL interceptors per engine
We may want to have, for example, a QQmlFileSelector and a component-specific interceptor that chooses a theme or similar. Also, make the API public. We want to propose this as alternative to dynamically registering QML files via qmlRegisterType(QUrl, ...). Change-Id: I4a535d3ea556da6710fde816579ec188b3f57099 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlcontext.cpp')
-rw-r--r--src/qml/qml/qqmlcontext.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/qml/qml/qqmlcontext.cpp b/src/qml/qml/qqmlcontext.cpp
index 9157bb95c3..abd379a320 100644
--- a/src/qml/qml/qqmlcontext.cpp
+++ b/src/qml/qml/qqmlcontext.cpp
@@ -465,9 +465,8 @@ QUrl QQmlContextData::resolvedUrl(const QUrl &src)
if (resolved.isEmpty()) //relative but no ctxt
return resolved;
- if (engine && engine->urlInterceptor())
- resolved = engine->urlInterceptor()->intercept(resolved, QQmlAbstractUrlInterceptor::UrlString);
- return resolved;
+ return engine ? engine->interceptUrl(resolved, QQmlAbstractUrlInterceptor::UrlString)
+ : resolved;
}