| 1 | /* |
| 2 | SPDX-FileCopyrightText: ⓒ 2025 Volker Krause <vkrause@kde.org> |
| 3 | SPDX-License-Identifier: LGPL-2.0-or-later |
| 4 | */ |
| 5 | |
| 6 | #include "kcolorutilssingleton.h" |
| 7 | |
| 8 | #include <QQmlEngine> |
| 9 | #include <QQmlExtensionPlugin> |
| 10 | |
| 11 | class KGuiAddonsPlugin : public QQmlExtensionPlugin |
| 12 | { |
| 13 | Q_OBJECT |
| 14 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface" ) |
| 15 | |
| 16 | public: |
| 17 | void registerTypes(const char *uri) override |
| 18 | { |
| 19 | qmlRegisterSingletonType(uri, versionMajor: 1, versionMinor: 0, typeName: "ColorUtils" , callback: [](QQmlEngine *engine, QJSEngine *) -> QJSValue { |
| 20 | return engine->toScriptValue(value: KColorUtilsSingleton()); |
| 21 | }); |
| 22 | } |
| 23 | }; |
| 24 | |
| 25 | #include "kguiaddonsplugin.moc" |
| 26 | |