File indexing completed on 2025-09-14 05:22:01
0001 /* 0002 SPDX-FileCopyrightText: 2022 Fushan Wen <qydwhotmail@gmail.com> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include <QQmlContext> 0008 #include <QQmlEngine> 0009 #include <QQmlExtensionPlugin> 0010 0011 #include "potdbackend.h" 0012 #include "potdprovider.h" 0013 #include "potdprovidermodel.h" 0014 0015 class PotdPlugin : public QQmlExtensionPlugin 0016 { 0017 Q_OBJECT 0018 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") 0019 0020 public: 0021 void registerTypes(const char *uri) override 0022 { 0023 qmlRegisterType<PotdBackend>(uri, 1, 0, "PotdBackend"); 0024 qmlRegisterType<PotdProviderModel>(uri, 1, 0, "PotdProviderModel"); 0025 0026 qmlRegisterUncreatableType<PotdBackend>(uri, 1, 0, "Global", QStringLiteral("Error: only enums")); 0027 } 0028 }; 0029 0030 #include "potdplugin.moc"