File indexing completed on 2024-11-24 05:00:36

0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 // SPDX-FileCopyrightText: 2023 Harald Sitter <sitter@kde.org>
0003 
0004 #include <QQmlExtensionPlugin>
0005 #include <QmlTypeAndRevisionsRegistration>
0006 
0007 #include <flags.h>
0008 
0009 using namespace Qt::StringLiterals;
0010 
0011 class Plugin : public QQmlExtensionPlugin
0012 {
0013     Q_OBJECT
0014     Q_PLUGIN_METADATA(IID "org.kde.plasma.private.kcm_keyboard")
0015 
0016 public:
0017     using QQmlExtensionPlugin::QQmlExtensionPlugin;
0018 
0019     void registerTypes(const char *uri) override
0020     {
0021         Q_ASSERT(QLatin1String(uri) == "org.kde.plasma.private.kcm_keyboard"_L1);
0022         qmlRegisterSingletonType<Flags>(uri, 1, 0, "Flags", [](QQmlEngine *, QJSEngine *) -> QObject * {
0023             return new Flags;
0024         });
0025     }
0026 };
0027 
0028 #include "plugin.moc"