diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-03-03 01:00:05 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-03-03 12:23:20 +0100 |
commit | 04e3918f0fd0c19ed830d406e1c549a037089cc4 (patch) | |
tree | 8e07ee9c550124b277983542e2ad0f7a791b5276 /src/qmlworkerscript | |
parent | b760d972459fd3b0c41e4c85076fa933ba5c0d1d (diff) | |
parent | 254a56252874b63430701351dcd8c9bef8507353 (diff) |
Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
src/qmlmodels/qqmltableinstancemodel.cpp
src/qmlmodels/qqmltableinstancemodel_p.h
Change-Id: I89339b1cb41ba27fe30c79530859a1c2bfbecc69
Diffstat (limited to 'src/qmlworkerscript')
-rw-r--r-- | src/qmlworkerscript/qquickworkerscript.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qmlworkerscript/qquickworkerscript.cpp b/src/qmlworkerscript/qquickworkerscript.cpp index 4a79027234..0bdbbabadc 100644 --- a/src/qmlworkerscript/qquickworkerscript.cpp +++ b/src/qmlworkerscript/qquickworkerscript.cpp @@ -130,7 +130,9 @@ struct WorkerScript : public QV4::ExecutionEngine { QQuickWorkerScriptEnginePrivate *p = nullptr; QUrl source; QQuickWorkerScript *owner = nullptr; +#if QT_CONFIG(qml_network) QScopedPointer<QNetworkAccessManager> scriptLocalNAM; +#endif int id = -1; }; @@ -390,6 +392,7 @@ WorkerScript::WorkerScript(int id, QQuickWorkerScriptEnginePrivate *parent) QV4::ScopedValue sendMessage(scope, QV4::FunctionObject::createBuiltinFunction(this, name, QQuickWorkerScriptEnginePrivate::method_sendMessage, 1)); api->put(QV4::ScopedString(scope, scope.engine->newString(QStringLiteral("sendMessage"))), sendMessage); globalObject->put(QV4::ScopedString(scope, scope.engine->newString(QStringLiteral("WorkerScript"))), api); +#if QT_CONFIG(qml_network) networkAccessManager = [](QV4::ExecutionEngine *engine){ auto *workerScript = static_cast<WorkerScript *>(engine); if (workerScript->scriptLocalNAM) @@ -400,6 +403,7 @@ WorkerScript::WorkerScript(int id, QQuickWorkerScriptEnginePrivate *parent) workerScript->scriptLocalNAM.reset(new QNetworkAccessManager(workerScript->p)); return workerScript->scriptLocalNAM.get(); }; +#endif // qml_network } int QQuickWorkerScriptEngine::registerWorkerScript(QQuickWorkerScript *owner) |