KIconThemes

kiconengineplugin.cpp
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  * Copyright (C) 2018 Fabian Vogt <[email protected]>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License version 2 as published by the Free Software Foundation.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21 
22 #include <QIconEnginePlugin>
23 
24 #include <KIconEngine>
25 #include <KIconLoader>
26 
27 QT_BEGIN_NAMESPACE
28 
29 class KIconEnginePlugin : public QIconEnginePlugin
30 {
31  Q_OBJECT
32  Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QIconEngineFactoryInterface" FILE "kiconengineplugin.json")
33 
34 public:
35  QIconEngine *create(const QString &file) override
36  {
37  return new KIconEngine(file, KIconLoader::global());
38  }
39 };
40 
41 QT_END_NAMESPACE
42 
43 #include "kiconengineplugin.moc"
A class to provide rendering of KDE icons.
Definition: kiconengine.h:43
virtual QIconEngine * create(const QString &filename)=0
Q_OBJECTQ_OBJECT
static KIconLoader * global()
Returns the global icon loader initialized with the application name.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue May 26 2020 22:51:59 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.