summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@qt.io>2018-09-11 01:26:05 +0200
committerMorten Johan Sørvig <morten.sorvig@qt.io>2018-09-12 13:56:04 +0000
commit8de1177df9568ccd80541a8015d2cd47cf2d0af4 (patch)
treef8b03cde554a0c5c31b93bdb6c08f74dcec6e122
parent6bf50496ea1fd6d3afd613bb1ce7bb66eead41b6 (diff)
Add qml-worker-script feature
Depends on features.thread. Change-Id: I65db68ac90c15af0ac0571ee021122f7ca2ca051 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r--src/qml/configure.json7
-rw-r--r--src/qml/qml/qqmlengine.cpp8
-rw-r--r--src/qml/qml/qqmlengine_p.h2
-rw-r--r--src/qml/types/types.pri2
4 files changed, 13 insertions, 6 deletions
diff --git a/src/qml/configure.json b/src/qml/configure.json
index 1e3ac65f2a..9d30dd7be2 100644
--- a/src/qml/configure.json
+++ b/src/qml/configure.json
@@ -96,6 +96,13 @@
"purpose": "Provides the DelegateModel QML type.",
"section": "QML",
"output": [ "privateFeature" ]
+ },
+ "qml-worker-script": {
+ "label": "QML WorkerScript",
+ "purpose": "Enables the use of threads in QML.",
+ "section": "QML",
+ "condition": "features.thread",
+ "output": [ "privateFeature" ]
}
},
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 82a3f45784..5f47376c62 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -95,7 +95,7 @@
#include <private/qqmldelegatemodel_p.h>
#endif
#include <private/qqmlobjectmodel_p.h>
-#if QT_CONFIG(thread)
+#if QT_CONFIG(qml_worker_script)
#include <private/qquickworkerscript_p.h>
#endif
#include <private/qqmlinstantiator_p.h>
@@ -245,7 +245,7 @@ void QQmlEnginePrivate::registerQtQuick2Types(const char *uri, int versionMajor,
qmlRegisterType<QQmlListElement>(uri, versionMajor, versionMinor, "ListElement"); // Now in QtQml.Models, here for compatibility
qmlRegisterCustomType<QQmlListModel>(uri, versionMajor, versionMinor, "ListModel", new QQmlListModelParser); // Now in QtQml.Models, here for compatibility
#endif
-#if QT_CONFIG(thread)
+#if QT_CONFIG(qml_worker_script)
qmlRegisterType<QQuickWorkerScript>(uri, versionMajor, versionMinor, "WorkerScript");
#endif
qmlRegisterType<QQuickPackage>(uri, versionMajor, versionMinor, "Package");
@@ -691,7 +691,7 @@ QQmlEnginePrivate::QQmlEnginePrivate(QQmlEngine *e)
#endif
outputWarningsToMsgLog(true),
cleanup(nullptr), erroredBindings(nullptr), inProgressCreations(0),
-#if QT_CONFIG(thread)
+#if QT_CONFIG(qml_worker_script)
workerScriptEngine(nullptr),
#endif
activeObjectCreator(nullptr),
@@ -993,7 +993,7 @@ void QQmlEnginePrivate::init()
rootContext = new QQmlContext(q,true);
}
-#if QT_CONFIG(thread)
+#if QT_CONFIG(qml_worker_script)
QQuickWorkerScriptEngine *QQmlEnginePrivate::getWorkerScriptEngine()
{
Q_Q(QQmlEngine);
diff --git a/src/qml/qml/qqmlengine_p.h b/src/qml/qml/qqmlengine_p.h
index d05f6634ec..3caa6ec138 100644
--- a/src/qml/qml/qqmlengine_p.h
+++ b/src/qml/qml/qqmlengine_p.h
@@ -153,7 +153,7 @@ public:
QV8Engine *v8engine() const { return q_func()->handle()->v8Engine; }
QV4::ExecutionEngine *v4engine() const { return q_func()->handle(); }
-#if QT_CONFIG(thread)
+#if QT_CONFIG(qml_worker_script)
QQuickWorkerScriptEngine *getWorkerScriptEngine();
QQuickWorkerScriptEngine *workerScriptEngine;
#endif
diff --git a/src/qml/types/types.pri b/src/qml/types/types.pri
index e0ff57a13e..e74c89b1f1 100644
--- a/src/qml/types/types.pri
+++ b/src/qml/types/types.pri
@@ -19,7 +19,7 @@ HEADERS += \
$$PWD/qqmlinstantiator_p_p.h \
$$PWD/qqmltableinstancemodel_p.h
-qtConfig(thread) {
+qtConfig(qml-worker-script) {
SOURCES += \
$$PWD/qquickworkerscript.cpp
HEADERS += \