diff options
Diffstat (limited to 'src/imports/localstorage')
-rw-r--r-- | src/imports/localstorage/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/imports/localstorage/localstorage.pro | 2 | ||||
-rw-r--r-- | src/imports/localstorage/plugin.cpp | 4 | ||||
-rw-r--r-- | src/imports/localstorage/qquicklocalstorage_p.h | 1 |
4 files changed, 8 insertions, 3 deletions
diff --git a/src/imports/localstorage/CMakeLists.txt b/src/imports/localstorage/CMakeLists.txt index 4727de7f93..d3fd8ff290 100644 --- a/src/imports/localstorage/CMakeLists.txt +++ b/src/imports/localstorage/CMakeLists.txt @@ -6,7 +6,7 @@ qt_add_qml_module(qmllocalstorageplugin URI "QtQuick.LocalStorage" - VERSION "2.15" + VERSION "${CMAKE_PROJECT_VERSION}" CLASSNAME QQmlLocalStoragePlugin SKIP_TYPE_REGISTRATION GENERATE_QMLTYPES @@ -21,6 +21,6 @@ qt_add_qml_module(qmllocalstorageplugin #### Keys ignored in scope 1:.:.:localstorage.pro:<TRUE>: # CXX_MODULE = "qml" -# IMPORT_VERSION = "2.15" # OTHER_FILES = "localstorage.json" +# QML_IMPORT_VERSION = "$$QT_VERSION" # TARGETPATH = "QtQuick/LocalStorage" diff --git a/src/imports/localstorage/localstorage.pro b/src/imports/localstorage/localstorage.pro index d189808f49..6dff4862c7 100644 --- a/src/imports/localstorage/localstorage.pro +++ b/src/imports/localstorage/localstorage.pro @@ -1,7 +1,7 @@ CXX_MODULE = qml TARGET = qmllocalstorageplugin TARGETPATH = QtQuick/LocalStorage -IMPORT_VERSION = 2.15 +QML_IMPORT_VERSION = $$QT_VERSION QT = sql qml-private core-private diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp index ae9f37784d..e488b3d43c 100644 --- a/src/imports/localstorage/plugin.cpp +++ b/src/imports/localstorage/plugin.cpp @@ -42,6 +42,8 @@ #include <QtQml/qqmlextensionplugin.h> #include <QtQml/qqml.h> +extern void qml_register_types_QtQuick_LocalStorage(); + QT_BEGIN_NAMESPACE class QQmlLocalStoragePlugin : public QQmlEngineExtensionPlugin @@ -52,6 +54,8 @@ class QQmlLocalStoragePlugin : public QQmlEngineExtensionPlugin public: QQmlLocalStoragePlugin(QObject *parent = nullptr) : QQmlEngineExtensionPlugin(parent) { + volatile auto registration = &qml_register_types_QtQuick_LocalStorage; + Q_UNUSED(registration); } }; diff --git a/src/imports/localstorage/qquicklocalstorage_p.h b/src/imports/localstorage/qquicklocalstorage_p.h index d2ebc85ce9..f90d6bad28 100644 --- a/src/imports/localstorage/qquicklocalstorage_p.h +++ b/src/imports/localstorage/qquicklocalstorage_p.h @@ -61,6 +61,7 @@ class QQuickLocalStorage : public QObject { Q_OBJECT QML_NAMED_ELEMENT(LocalStorage) + QML_ADDED_IN_VERSION(2, 0) QML_SINGLETON public: |