aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/workerscript
diff options
context:
space:
mode:
authorLeander Beernaert <leander.beernaert@qt.io>2020-01-16 16:25:06 +0100
committerLeander Beernaert <leander.beernaert@qt.io>2020-01-16 16:25:06 +0100
commit1d333d3375874efb8d37df37dc5ef561573794ad (patch)
tree2d8c995f64c05c84c1fcceb2c5cb40fcae69855f /src/imports/workerscript
parentb106d86c433706928b0b0c206a0d9f831681e1bf (diff)
parente79a2658cde899d6ee11ec3c0d0a3768eb2c864b (diff)
Merge remote-tracking branch 'origin/dev' into wip/cmake
Diffstat (limited to 'src/imports/workerscript')
-rw-r--r--src/imports/workerscript/plugin.cpp26
-rw-r--r--src/imports/workerscript/plugins.qmltypes26
-rw-r--r--src/imports/workerscript/workerscript.pro2
3 files changed, 17 insertions, 37 deletions
diff --git a/src/imports/workerscript/plugin.cpp b/src/imports/workerscript/plugin.cpp
index 2d8797db7e..0961979c53 100644
--- a/src/imports/workerscript/plugin.cpp
+++ b/src/imports/workerscript/plugin.cpp
@@ -37,12 +37,17 @@
**
****************************************************************************/
-#include <QtQmlWorkerScript/private/qqmlworkerscriptmodule_p.h>
+#include <QtQmlWorkerScript/private/qquickworkerscript_p.h>
+
#include <QtQml/qqmlextensionplugin.h>
#include <QtQml/qqml.h>
+#include <QtCore/qloggingcategory.h>
+
QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(workerScriptPlugin, "qt.workerScriptPlugin")
+
/*!
\qmlmodule QtQml.WorkerScript 2.\QtMinorVersion
\title Qt QML WorkerScript QML Types
@@ -59,19 +64,20 @@ QT_BEGIN_NAMESPACE
\endqml
*/
-class QtQmlWorkerScriptPlugin : public QQmlExtensionPlugin
+class QtQmlWorkerScriptPlugin : public QQmlEngineExtensionPlugin
{
Q_OBJECT
- Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
+ Q_PLUGIN_METADATA(IID QQmlEngineExtensionInterface_iid)
public:
- QtQmlWorkerScriptPlugin(QObject *parent = nullptr) : QQmlExtensionPlugin(parent) { }
- void registerTypes(const char *uri) override
+ QtQmlWorkerScriptPlugin(QObject *parent = nullptr) : QQmlEngineExtensionPlugin(parent)
{
- Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQml.WorkerScript"));
-
- QQmlWorkerScriptModule::defineModule();
-
- qmlRegisterModule(uri, 2, 15);
+ if (workerScriptPlugin().isDebugEnabled()) {
+ // Superficial debug message that causes the dependency between QtQmlWorkerScript
+ // and the workerscript plugin to be retained.
+ // As qCDebug() can be a noop, retrieve the className in a separate step.
+ const QString className = QQuickWorkerScript::staticMetaObject.className();
+ qCDebug(workerScriptPlugin) << "Loading WorkerScript plugin:" << className;
+ }
}
};
diff --git a/src/imports/workerscript/plugins.qmltypes b/src/imports/workerscript/plugins.qmltypes
deleted file mode 100644
index b1d6107022..0000000000
--- a/src/imports/workerscript/plugins.qmltypes
+++ /dev/null
@@ -1,26 +0,0 @@
-import QtQuick.tooling 1.2
-
-// This file describes the plugin-supplied types contained in the library.
-// It is used for QML tooling purposes only.
-//
-// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQml.WorkerScript 2.14'
-
-Module {
- dependencies: []
- Component {
- name: "QQuickWorkerScript"
- prototype: "QObject"
- exports: ["QtQml.WorkerScript/WorkerScript 2.0"]
- exportMetaObjectRevisions: [0]
- Property { name: "source"; type: "QUrl" }
- Signal {
- name: "message"
- Parameter { name: "messageObject"; type: "QJSValue" }
- }
- Method {
- name: "sendMessage"
- Parameter { type: "QQmlV4Function"; isPointer: true }
- }
- }
-}
diff --git a/src/imports/workerscript/workerscript.pro b/src/imports/workerscript/workerscript.pro
index d48e285bda..aa68d193b4 100644
--- a/src/imports/workerscript/workerscript.pro
+++ b/src/imports/workerscript/workerscript.pro
@@ -1,7 +1,7 @@
CXX_MODULE = qml
TARGET = workerscriptplugin
TARGETPATH = QtQml/WorkerScript.2
-IMPORT_VERSION = 2.$$QT_MINOR_VERSION
+IMPORT_VERSION = 2.15
SOURCES += \
plugin.cpp