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 <QQmlEngine>
7 #include <QQmlExtensionPlugin>
8 
9 #include "../core/kpluginproxymodel.h"
10 
11 class KCMUtilsQmlPlugin : public QQmlExtensionPlugin
12 {
13  Q_OBJECT
14  Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
15 public:
16  void initializeEngine(QQmlEngine * /*engine*/, const char *uri) override
17  {
18  Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.kcmutils"));
19  qmlRegisterType<KPluginProxyModel>("org.kde.kcmutils.private", 1, 0, "ProxyModel");
20  }
21 
22  void registerTypes(const char *uri) override
23  {
24  Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.kcmutils"));
25  qmlRegisterModule(uri, 1, 0);
26  };
27 };
28 
29 #include "qmlplugin.moc"
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Jun 26 2022 03:51:23 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.