| 1 | /* |
| 2 | kiconengineplugin.cpp: Qt plugin providing the ability to create a KIconEngine |
| 3 | |
| 4 | This file is part of the KDE project, module kdeui. |
| 5 | SPDX-FileCopyrightText: 2018 Fabian Vogt <fabian@ritter-vogt.de> |
| 6 | |
| 7 | SPDX-License-Identifier: LGPL-2.0-only |
| 8 | */ |
| 9 | |
| 10 | #include <QIconEnginePlugin> |
| 11 | |
| 12 | #include <KIconEngine> |
| 13 | #include <KIconLoader> |
| 14 | |
| 15 | QT_BEGIN_NAMESPACE |
| 16 | |
| 17 | class KIconEnginePlugin : public QIconEnginePlugin |
| 18 | { |
| 19 | Q_OBJECT |
| 20 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QIconEngineFactoryInterface" FILE "kiconengineplugin.json" ) |
| 21 | |
| 22 | public: |
| 23 | QIconEngine *create(const QString &file) override |
| 24 | { |
| 25 | return new KIconEngine(file, KIconLoader::global()); |
| 26 | } |
| 27 | }; |
| 28 | |
| 29 | QT_END_NAMESPACE |
| 30 | |
| 31 | #include "kiconengineplugin.moc" |
| 32 | |