diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-08-22 16:36:42 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-01-10 18:01:27 +0100 |
commit | 1cd494fbfb3eaf21717697c3c7df39b214b48ee3 (patch) | |
tree | 6ec56567a6f3355b1814ac18169d354239a729fc /src/imports/statemachine | |
parent | 8550dff55c62b4f2b588513014b5cad8fe2c5f5b (diff) |
Generate registrations for all imports
Now that we can generate all QML type information at build time, we
should also use it.
Move the types for QtTest into the testlib import plugin. They don't
need to be exported from QtQuickTest.
Trigger the resource initialization of the shapes library from the
plugin so that we retain a dependency and the linker doesn't optimize
the module initialization away.
Change-Id: Icc8cb338aa03ef1e3085e29356a5db7b73ba0a01
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/imports/statemachine')
-rw-r--r-- | src/imports/statemachine/plugin.cpp | 17 | ||||
-rw-r--r-- | src/imports/statemachine/plugins.qmltypes | 179 | ||||
-rw-r--r-- | src/imports/statemachine/statemachine.pro | 2 |
3 files changed, 5 insertions, 193 deletions
diff --git a/src/imports/statemachine/plugin.cpp b/src/imports/statemachine/plugin.cpp index c36e5097c6..4c991994f3 100644 --- a/src/imports/statemachine/plugin.cpp +++ b/src/imports/statemachine/plugin.cpp @@ -50,24 +50,13 @@ QT_BEGIN_NAMESPACE -class QtQmlStateMachinePlugin : public QQmlExtensionPlugin +class QtQmlStateMachinePlugin : public QQmlEngineExtensionPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) + Q_PLUGIN_METADATA(IID QQmlEngineExtensionInterface_iid) public: - QtQmlStateMachinePlugin(QObject *parent = nullptr) : QQmlExtensionPlugin(parent) { } - void registerTypes(const char *uri) override - { - qmlRegisterTypesAndRevisions< - State, StateMachine, FinalState, TimeoutTransition, SignalTransition, - QHistoryStateForeign, QStateForeign, QAbstractStateForeign, QSignalTransitionForeign - >(uri, 1); - qmlProtectModule(uri, 1); - - // Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward - qmlRegisterModule(uri, 1, QT_VERSION_MINOR); - } + QtQmlStateMachinePlugin(QObject *parent = nullptr) : QQmlEngineExtensionPlugin(parent) { } }; QT_END_NAMESPACE diff --git a/src/imports/statemachine/plugins.qmltypes b/src/imports/statemachine/plugins.qmltypes deleted file mode 100644 index 206159f057..0000000000 --- a/src/imports/statemachine/plugins.qmltypes +++ /dev/null @@ -1,179 +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.StateMachine 1.14' - -Module { - dependencies: [] - Component { - name: "FinalState" - defaultProperty: "children" - prototype: "QFinalState" - exports: ["QtQml.StateMachine/FinalState 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "children"; type: "QObject"; isList: true; isReadonly: true } - } - Component { - name: "QAbstractState" - prototype: "QObject" - exports: ["QtQml.StateMachine/QAbstractState 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Property { name: "active"; type: "bool"; isReadonly: true } - Signal { name: "entered" } - Signal { name: "exited" } - Signal { - name: "activeChanged" - Parameter { name: "active"; type: "bool" } - } - } - Component { - name: "QAbstractTransition" - prototype: "QObject" - Enum { - name: "TransitionType" - values: { - "ExternalTransition": 0, - "InternalTransition": 1 - } - } - Property { name: "sourceState"; type: "QState"; isReadonly: true; isPointer: true } - Property { name: "targetState"; type: "QAbstractState"; isPointer: true } - Property { name: "targetStates"; type: "QList<QAbstractState*>" } - Property { name: "transitionType"; revision: 1; type: "TransitionType" } - Signal { name: "triggered" } - } - Component { name: "QFinalState"; prototype: "QAbstractState" } - Component { - name: "QHistoryState" - prototype: "QAbstractState" - exports: ["QtQml.StateMachine/HistoryState 1.0"] - exportMetaObjectRevisions: [0] - Enum { - name: "HistoryType" - values: { - "ShallowHistory": 0, - "DeepHistory": 1 - } - } - Property { name: "defaultState"; type: "QAbstractState"; isPointer: true } - Property { name: "defaultTransition"; type: "QAbstractTransition"; isPointer: true } - Property { name: "historyType"; type: "HistoryType" } - } - Component { - name: "QSignalTransition" - prototype: "QAbstractTransition" - exports: ["QtQml.StateMachine/QSignalTransition 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Property { name: "senderObject"; type: "QObject"; isPointer: true } - Property { name: "signal"; type: "QByteArray" } - } - Component { - name: "QState" - prototype: "QAbstractState" - exports: ["QtQml.StateMachine/QState 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Enum { - name: "ChildMode" - values: { - "ExclusiveStates": 0, - "ParallelStates": 1 - } - } - Enum { - name: "RestorePolicy" - values: { - "DontRestoreProperties": 0, - "RestoreProperties": 1 - } - } - Property { name: "initialState"; type: "QAbstractState"; isPointer: true } - Property { name: "errorState"; type: "QAbstractState"; isPointer: true } - Property { name: "childMode"; type: "ChildMode" } - Signal { name: "finished" } - Signal { name: "propertiesAssigned" } - } - Component { - name: "QStateMachine" - prototype: "QState" - Property { name: "errorString"; type: "string"; isReadonly: true } - Property { name: "globalRestorePolicy"; type: "QState::RestorePolicy" } - Property { name: "running"; type: "bool" } - Property { name: "animated"; type: "bool" } - Signal { name: "started" } - Signal { name: "stopped" } - Signal { - name: "runningChanged" - Parameter { name: "running"; type: "bool" } - } - Method { name: "start" } - Method { name: "stop" } - Method { - name: "setRunning" - Parameter { name: "running"; type: "bool" } - } - } - Component { - name: "QTimer" - prototype: "QObject" - Property { name: "singleShot"; type: "bool" } - Property { name: "interval"; type: "int" } - Property { name: "remainingTime"; type: "int"; isReadonly: true } - Property { name: "timerType"; type: "Qt::TimerType" } - Property { name: "active"; type: "bool"; isReadonly: true } - Signal { name: "timeout" } - Method { - name: "start" - Parameter { name: "msec"; type: "int" } - } - Method { name: "start" } - Method { name: "stop" } - } - Component { - name: "SignalTransition" - prototype: "QSignalTransition" - exports: [ - "QtQml.StateMachine/SignalTransition 1.0", - "QtQml.StateMachine/SignalTransition 1.1" - ] - exportMetaObjectRevisions: [0, 1] - Property { name: "signal"; type: "QJSValue" } - Property { name: "guard"; type: "QQmlScriptString" } - Signal { name: "invokeYourself" } - Signal { name: "qmlSignalChanged" } - Method { name: "invoke" } - } - Component { - name: "State" - defaultProperty: "children" - prototype: "QState" - exports: ["QtQml.StateMachine/State 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "children"; type: "QObject"; isList: true; isReadonly: true } - } - Component { - name: "StateMachine" - defaultProperty: "children" - prototype: "QStateMachine" - exports: ["QtQml.StateMachine/StateMachine 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "children"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "running"; type: "bool" } - Signal { name: "qmlRunningChanged" } - } - Component { - name: "TimeoutTransition" - prototype: "QSignalTransition" - exports: [ - "QtQml.StateMachine/TimeoutTransition 1.0", - "QtQml.StateMachine/TimeoutTransition 1.1" - ] - exportMetaObjectRevisions: [0, 1] - Property { name: "timeout"; type: "int" } - } -} diff --git a/src/imports/statemachine/statemachine.pro b/src/imports/statemachine/statemachine.pro index 7affc768e2..d4977d8eb8 100644 --- a/src/imports/statemachine/statemachine.pro +++ b/src/imports/statemachine/statemachine.pro @@ -22,4 +22,6 @@ HEADERS = \ $$PWD/timeouttransition.h \ $$PWD/statemachineforeign.h +CONFIG += qmltypes install_qmltypes + load(qml_plugin) |