Kirigami-addons

componentslabsplugin.cpp
1// SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
2// SPDX-FileCopyrightText: 2022 Carl Schwan <carl@carlschwan.eu>
3// SPDX-License-Identifier: LGPL-2.0-or-later
4
5#include <QQmlExtensionPlugin>
6#include <QQmlEngine>
7#include "nameutils.h"
8
9class ComponentsLabsPlugin : public QQmlExtensionPlugin
10{
12 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
13
14public:
15 ComponentsLabsPlugin() = default;
16 ~ComponentsLabsPlugin() = default;
17 void registerTypes(const char *uri) override
18 {
19 qmlRegisterModule(uri, 1, 0);
20 qmlRegisterSingletonType<NameUtils>(uri, 1, 0, "NameUtils", [](QQmlEngine*, QJSEngine*) -> QObject* {
21 return new NameUtils;
22 });
23 }
24};
25
26#include "componentslabsplugin.moc"
Q_OBJECTQ_OBJECT
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:05:53 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.