KCMUtils

qmlplugin.cpp
1 /*
2  SPDX-FileCopyrightText: 2022 Alexander Lohnau <[email protected]>
3  SPDX-License-Identifier: LGPL-2.0-or-later
4 */
5 
6 #include <QQmlExtensionPlugin>
7 
8 #include "../core/kpluginproxymodel.h"
9 #include "kcmlauncher_p.h"
10 #include "kquickconfigmodule.h"
11 #include "settinghighlighterprivate.h"
12 #include "settingstateproxy.h"
13 
14 class KCMUtilsQmlPlugin : public QQmlExtensionPlugin
15 {
16  Q_OBJECT
17  Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
18 public:
19  void registerTypes(const char *uri) override
20  {
21  qmlRegisterType<KPluginProxyModel>("org.kde.kcmutils.private", 1, 0, "ProxyModel");
22  qmlRegisterModule(uri, 1, 0);
23  qmlRegisterUncreatableType<KQuickConfigModule>(uri, 1, 0, "ConfigModule", QLatin1String("Do not create objects of type ConfigModule"));
24  qmlRegisterType<SettingStateProxy>(uri, 1, 0, "SettingStateProxy");
25  qmlRegisterType<SettingHighlighterPrivate>("org.kde.kcmutils.private", 1, 0, "SettingHighlighterPrivate");
26  qmlRegisterSingletonType<KCMLauncher>(uri, 1, 0, "KCMLauncher", [](QQmlEngine *, QJSEngine *) {
27  return new KCMLauncher();
28  });
29  }
30 };
31 
32 #include "qmlplugin.moc"
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Jun 6 2023 04:03:57 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.