KCoreAddons

kcoreaddonsplugin.cpp
1/*
2 SPDX-FileCopyrightText: 2014 Bhushan Shah <bhush94@gmail.com>
3 SPDX-FileCopyrightText: 2014 David Edmundson <davidedmundson@kde.org>
4 SPDX-FileCopyrightText: 2023 Alexander Lohnau <alexander.lohnau@gmx.de>
5
6 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7*/
8
9#include <QQmlEngine>
10#include <QQmlExtensionPlugin>
11
12#include "formats.h"
13#include "kuserproxy.h"
14#include <KAboutData>
15#include <KFormat>
16
17class KCoreAddonsPlugin : public QQmlExtensionPlugin
18{
20 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
21
22public:
23 void registerTypes(const char *uri) override
24 {
25 qmlRegisterSingletonType<Formats>(uri, 1, 0, "Format", [](QQmlEngine *, QJSEngine *) {
26 return new Formats();
27 });
28 qRegisterMetaType<QLocale::FormatType>();
29 qmlRegisterUncreatableMetaObject(KFormat::staticMetaObject, uri, 1, 0, "FormatTypes", QString());
30 qmlRegisterType<KUserProxy>(uri, 1, 0, "KUser");
31 qmlRegisterSingletonType(uri, 1, 0, "AboutData", [](QQmlEngine *engine, QJSEngine *) -> QJSValue {
33 });
34 }
35};
36
37#include "kcoreaddonsplugin.moc"
static KAboutData applicationData()
Returns the KAboutData for the application.
QJSValue toScriptValue(const T &value)
Q_OBJECTQ_OBJECT
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:22 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.