diff options
Diffstat (limited to 'src/imports/folderlistmodel/plugin.cpp')
-rw-r--r-- | src/imports/folderlistmodel/plugin.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/imports/folderlistmodel/plugin.cpp b/src/imports/folderlistmodel/plugin.cpp index 31cd793737..7a38769b77 100644 --- a/src/imports/folderlistmodel/plugin.cpp +++ b/src/imports/folderlistmodel/plugin.cpp @@ -42,6 +42,8 @@ #include "qquickfolderlistmodel.h" +extern void qml_register_types_Qt_labs_folderlistmodel(); + QT_BEGIN_NAMESPACE //![class decl] @@ -51,23 +53,18 @@ class QmlFolderListModelPlugin : public QQmlExtensionPlugin Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) public: - QmlFolderListModelPlugin(QObject *parent = nullptr) : QQmlExtensionPlugin(parent) { } + QmlFolderListModelPlugin(QObject *parent = nullptr) : QQmlExtensionPlugin(parent) + { + volatile auto registration = &qml_register_types_Qt_labs_folderlistmodel; + Q_UNUSED(registration); + } + void registerTypes(const char *uri) override { Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.folderlistmodel")); - qmlRegisterType<QQuickFolderListModel>(uri,1,0,"FolderListModel"); - qmlRegisterType<QQuickFolderListModel>(uri,2,0,"FolderListModel"); - qmlRegisterType<QQuickFolderListModel,1>(uri,2,1,"FolderListModel"); - qmlRegisterType<QQuickFolderListModel,2>(uri,2,2,"FolderListModel"); - - // Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward - qmlRegisterModule(uri, 2, QT_VERSION_MINOR); - - // revision in Qt 5.11: added status property - qmlRegisterType<QQuickFolderListModel,11>(uri, 2, 11, "FolderListModel"); - // revision in Qt 5.12: added sortCaseSensitive property - qmlRegisterType<QQuickFolderListModel,12>(uri, 2, 12, "FolderListModel"); + // Major version 1 only has a single revision, 0. + qmlRegisterType<QQuickFolderListModel>(uri, 1, 0, "FolderListModel"); } }; //![class decl] |