From 8de1177df9568ccd80541a8015d2cd47cf2d0af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 11 Sep 2018 01:26:05 +0200 Subject: Add qml-worker-script feature Depends on features.thread. Change-Id: I65db68ac90c15af0ac0571ee021122f7ca2ca051 Reviewed-by: Simon Hausmann Reviewed-by: Lorn Potter Reviewed-by: Ulf Hermann --- src/qml/configure.json | 7 +++++++ src/qml/qml/qqmlengine.cpp | 8 ++++---- src/qml/qml/qqmlengine_p.h | 2 +- src/qml/types/types.pri | 2 +- 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 #endif #include -#if QT_CONFIG(thread) +#if QT_CONFIG(qml_worker_script) #include #endif #include @@ -245,7 +245,7 @@ void QQmlEnginePrivate::registerQtQuick2Types(const char *uri, int versionMajor, qmlRegisterType(uri, versionMajor, versionMinor, "ListElement"); // Now in QtQml.Models, here for compatibility qmlRegisterCustomType(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(uri, versionMajor, versionMinor, "WorkerScript"); #endif qmlRegisterType(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 += \ -- cgit v1.2.3