aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlworkerscript
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-03-09 01:00:06 +0100
committerUlf Hermann <ulf.hermann@qt.io>2020-03-09 09:58:49 +0100
commitd51d5ff3c187821929cf7b765e037423bcc90466 (patch)
tree0eed81eb1709759058ff2b3b4595ea18774a44c4 /src/qmlworkerscript
parenteacb1a08ee4dace7c12a6eed153b9ec69cf95966 (diff)
parent12ddd8da1b2dcfbbca10a6915547456601a726c0 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts: src/qml/compiler/qqmlirbuilder_p.h src/qml/qml/qqmlpropertycachecreator_p.h src/qmltyperegistrar/qmltypesclassdescription.cpp src/qmltyperegistrar/qmltypesclassdescription.h src/qmltyperegistrar/qmltypescreator.cpp src/quick/items/qquicktext_p.h src/quick/util/qquickvaluetypes_p.h Change-Id: Ic209741592e7b85820bf3845722023a190ebc1c5
Diffstat (limited to 'src/qmlworkerscript')
-rw-r--r--src/qmlworkerscript/dependencies.json2
-rw-r--r--src/qmlworkerscript/qquickworkerscript.cpp4
-rw-r--r--src/qmlworkerscript/qquickworkerscript_p.h4
3 files changed, 8 insertions, 2 deletions
diff --git a/src/qmlworkerscript/dependencies.json b/src/qmlworkerscript/dependencies.json
new file mode 100644
index 0000000000..0d4f101c7a
--- /dev/null
+++ b/src/qmlworkerscript/dependencies.json
@@ -0,0 +1,2 @@
+[
+]
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)
diff --git a/src/qmlworkerscript/qquickworkerscript_p.h b/src/qmlworkerscript/qquickworkerscript_p.h
index 50eb8353b4..d1ea34422a 100644
--- a/src/qmlworkerscript/qquickworkerscript_p.h
+++ b/src/qmlworkerscript/qquickworkerscript_p.h
@@ -88,7 +88,7 @@ class Q_AUTOTEST_EXPORT QQuickWorkerScript : public QObject, public QQmlParserSt
{
Q_OBJECT
Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
- Q_PROPERTY(bool ready READ ready NOTIFY readyChanged)
+ Q_PROPERTY(bool ready READ ready NOTIFY readyChanged REVISION(2, 15))
QML_NAMED_ELEMENT(WorkerScript);
QML_ADDED_IN_VERSION(2, 0)
@@ -108,7 +108,7 @@ public Q_SLOTS:
Q_SIGNALS:
void sourceChanged();
- void readyChanged();
+ Q_REVISION(2, 15) void readyChanged();
void message(const QJSValue &messageObject);
protected: