diff options
Diffstat (limited to 'src/imports/window')
-rw-r--r-- | src/imports/window/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/imports/window/plugin.cpp | 8 | ||||
-rw-r--r-- | src/imports/window/plugin.h | 20 | ||||
-rw-r--r-- | src/imports/window/window.pro | 2 |
4 files changed, 25 insertions, 9 deletions
diff --git a/src/imports/window/CMakeLists.txt b/src/imports/window/CMakeLists.txt index c300126bac..99cedf333c 100644 --- a/src/imports/window/CMakeLists.txt +++ b/src/imports/window/CMakeLists.txt @@ -6,7 +6,7 @@ qt_add_qml_module(windowplugin URI "QtQuick.Window" - VERSION "2.15" + VERSION "${CMAKE_PROJECT_VERSION}" DESIGNER_SUPPORTED CLASSNAME QtQuick2WindowPlugin SKIP_TYPE_REGISTRATION @@ -22,5 +22,5 @@ qt_add_qml_module(windowplugin #### Keys ignored in scope 1:.:.:window.pro:<TRUE>: # CXX_MODULE = "qml" -# IMPORT_VERSION = "2.15" +# QML_IMPORT_VERSION = "$$QT_VERSION" # TARGETPATH = "QtQuick/Window" diff --git a/src/imports/window/plugin.cpp b/src/imports/window/plugin.cpp index ec4f2c5d2a..5152fa02ec 100644 --- a/src/imports/window/plugin.cpp +++ b/src/imports/window/plugin.cpp @@ -41,6 +41,8 @@ #include "plugin.h" +extern void qml_register_types_QtQuick_Window(); + QT_BEGIN_NAMESPACE /*! @@ -64,7 +66,11 @@ class QtQuick2WindowPlugin : public QQmlEngineExtensionPlugin Q_OBJECT Q_PLUGIN_METADATA(IID QQmlEngineExtensionInterface_iid) public: - QtQuick2WindowPlugin(QObject *parent = nullptr) : QQmlEngineExtensionPlugin(parent) { } + QtQuick2WindowPlugin(QObject *parent = nullptr) : QQmlEngineExtensionPlugin(parent) + { + volatile auto registration = &qml_register_types_QtQuick_Window; + Q_UNUSED(registration); + } }; //![class decl] diff --git a/src/imports/window/plugin.h b/src/imports/window/plugin.h index 9f58ca9ac7..625a77b12c 100644 --- a/src/imports/window/plugin.h +++ b/src/imports/window/plugin.h @@ -65,7 +65,7 @@ struct QWindowForeign Q_GADGET QML_FOREIGN(QWindow) QML_ANONYMOUS - QML_ADDED_IN_MINOR_VERSION(1) + QML_ADDED_IN_VERSION(2, 1) }; struct QQuickWindowForeign @@ -73,8 +73,8 @@ struct QQuickWindowForeign Q_GADGET QML_FOREIGN(QQuickWindow) QML_NAMED_ELEMENT(Window) - QML_ADDED_IN_MINOR_VERSION(0) - QML_REMOVED_IN_MINOR_VERSION(1) + QML_ADDED_IN_VERSION(2, 0) + QML_REMOVED_IN_VERSION(2, 1) }; struct QQuickWindowForeignAttached @@ -82,6 +82,7 @@ struct QQuickWindowForeignAttached Q_GADGET QML_FOREIGN(QQuickWindowAttached) QML_ANONYMOUS + QML_ADDED_IN_VERSION(2, 0) }; struct QQuickScreenInfoForeign @@ -89,7 +90,7 @@ struct QQuickScreenInfoForeign Q_GADGET QML_FOREIGN(QQuickScreenInfo) QML_NAMED_ELEMENT(ScreenInfo) - QML_ADDED_IN_MINOR_VERSION(3) + QML_ADDED_IN_VERSION(2, 3) QML_UNCREATABLE("ScreenInfo can only be used via the attached property.") }; @@ -98,6 +99,7 @@ struct QQuickScreenForeignAttached Q_GADGET QML_FOREIGN(QQuickScreenAttached) QML_ANONYMOUS + QML_ADDED_IN_VERSION(2, 0) }; struct QQuickScreenForeign @@ -105,6 +107,7 @@ struct QQuickScreenForeign Q_GADGET QML_FOREIGN(QQuickScreen) QML_NAMED_ELEMENT(Screen) + QML_ADDED_IN_VERSION(2, 0) QML_UNCREATABLE("Screen can only be used via the attached property.") }; @@ -113,7 +116,14 @@ struct QQuickWindowQmlImplForeign Q_GADGET QML_FOREIGN(QQuickWindowQmlImpl) QML_NAMED_ELEMENT(Window) - QML_ADDED_IN_MINOR_VERSION(1) + QML_ADDED_IN_VERSION(2, 1) +}; + +struct QQuickRootItemForeign +{ + Q_GADGET + QML_FOREIGN(QQuickRootItem) + QML_ANONYMOUS }; QT_END_NAMESPACE diff --git a/src/imports/window/window.pro b/src/imports/window/window.pro index 70af305937..d8f9b16df4 100644 --- a/src/imports/window/window.pro +++ b/src/imports/window/window.pro @@ -1,7 +1,7 @@ CXX_MODULE = qml TARGET = windowplugin TARGETPATH = QtQuick/Window -IMPORT_VERSION = 2.15 +QML_IMPORT_VERSION = $$QT_VERSION SOURCES += \ plugin.cpp |