aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlapplicationengine.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-02-07 16:59:51 +0100
committerUlf Hermann <ulf.hermann@qt.io>2020-03-19 15:04:55 +0100
commit75563fa761b94e049de0a29e91591610b0d15745 (patch)
treef013158c9d571a7c109572725de7cbfd1e73f51f /src/qml/qml/qqmlapplicationengine.h
parent585ee10c63d9e69dce07674db99c92a3814da157 (diff)
Clean up QQmlFileSelector
The global static map of file selectors is not thread safe. If you add a file selector to engine A running in thread 1, you cannot at the same time retrieve the file selector of engine B running in thread 2. Alas, we only need the static map to discern file selectors from other URL interceptors, and we only need to do this on QQmlFileSelector::get(), which we don't use. Unfortunately it is public API, though. Deprecate QQmlFileSelector::get() and add a different hack to discern the interceptors for the case that it's still called. Also remove the duplicate setExtraSelectors() method. For this to work, we also add a method to QQmlApplicationEngine that allows us to pass extra file selectors and delay the initialization of QQmlApplicationEngine's QQmlFileSelector until the first file is loaded. [ChangeLog][QML] QQmlFileSelector::get() is deprecated. You can use the new method QQmlAplicationEngine::setExtraFileSelectors() to pass extra selectors to QQmlApplicationEngine's internal QQmlFileSelector. Manually created QQmlFileSelectors should be configured immediately after creation, before they are used by the QQmlEngine. Change-Id: Ia61a93777dc910b441a03ffb42d35a2a224c0e26 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlapplicationengine.h')
-rw-r--r--src/qml/qml/qqmlapplicationengine.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlapplicationengine.h b/src/qml/qml/qqmlapplicationengine.h
index 37f75d5068..7faa51892e 100644
--- a/src/qml/qml/qqmlapplicationengine.h
+++ b/src/qml/qml/qqmlapplicationengine.h
@@ -67,6 +67,7 @@ public Q_SLOTS:
void load(const QUrl &url);
void load(const QString &filePath);
void setInitialProperties(const QVariantMap &initialProperties);
+ void setExtraFileSelectors(const QStringList &extraFileSelectors);
void loadData(const QByteArray &data, const QUrl &url = QUrl());
Q_SIGNALS: