aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2020-03-09 14:47:01 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2020-03-13 09:01:14 +0100
commit79a9d8f398aea3acb8194b3e6b82ae869a920220 (patch)
tree376b3e406205bca96e754dbaed0ae2295a842c71 /src/imports
parentf3f845f2999f1635bc0469ef4ec1015e6d97736e (diff)
QmlFolderListModelPlugin: unregister registered type
Change-Id: I29db8c652d85db5d9b92fd184632680a0ad06e55 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/folderlistmodel/plugin.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/imports/folderlistmodel/plugin.cpp b/src/imports/folderlistmodel/plugin.cpp
index 7a38769b77..9f8f14093e 100644
--- a/src/imports/folderlistmodel/plugin.cpp
+++ b/src/imports/folderlistmodel/plugin.cpp
@@ -39,6 +39,7 @@
#include <QtQml/qqmlextensionplugin.h>
#include <QtQml/qqml.h>
+#include <QtQml/private/qqmlmetatype_p.h>
#include "qquickfolderlistmodel.h"
@@ -64,8 +65,16 @@ public:
Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.folderlistmodel"));
// Major version 1 only has a single revision, 0.
- qmlRegisterType<QQuickFolderListModel>(uri, 1, 0, "FolderListModel");
+ folderListModelId = qmlRegisterType<QQuickFolderListModel>(uri, 1, 0, "FolderListModel");
}
+
+ void unregisterTypes() override {
+ QQmlMetaType::unregisterType(folderListModelId);
+ folderListModelId = -1;
+ }
+
+private:
+ int folderListModelId = -1;
};
//![class decl]