Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qiconengineplugin.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
6#include "qiconengine.h"
7
9
10/*!
11 \class QIconEnginePlugin
12 \brief The QIconEnginePlugin class provides an abstract base for custom QIconEngine plugins.
13
14 \ingroup plugins
15 \inmodule QtGui
16
17 The icon engine plugin is a simple plugin interface that makes it easy to
18 create custom icon engines that can be loaded dynamically into applications
19 through QIcon. QIcon uses the file or resource name's suffix to determine
20 what icon engine to use.
21
22 Writing a icon engine plugin is achieved by subclassing this base class,
23 reimplementing the pure virtual function create(), and
24 exporting the class with the Q_PLUGIN_METADATA() macro.
25
26 The json metadata should contain a list of icon engine keys that this plugin supports.
27 The keys correspond to the suffix of the file or resource name used when the plugin was
28 created. Keys are case insensitive.
29
30 \code
31 { "Keys": [ "myiconengine" ] }
32 \endcode
33
34 \sa {How to Create Qt Plugins}
35*/
36
37/*!
38 \fn QIconEngine* QIconEnginePlugin::create(const QString& filename)
39
40 Creates and returns a QIconEngine object for the icon with the given
41 \a filename.
42*/
43
44/*!
45 Constructs a icon engine plugin with the given \a parent. This is invoked
46 automatically by the plugin loader.
47*/
48QIconEnginePlugin::QIconEnginePlugin(QObject *parent)
49 : QObject(parent)
50{
51}
52
53/*!
54 Destroys the icon engine plugin.
55
56 You never have to call this explicitly. Qt destroys a plugin
57 automatically when it is no longer used.
58*/
59QIconEnginePlugin::~QIconEnginePlugin()
60{
61}
62
63
64QT_END_NAMESPACE
65
66#include "moc_qiconengineplugin.cpp"
Combined button and popup list for selecting options.