Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/widgets/styles/qstyleplugin.cpp |
Source code | Switch to Preprocessed file |
Line | Source | Count |
---|---|---|
1 | /**************************************************************************** | - |
2 | ** | - |
3 | ** Copyright (C) 2015 The Qt Company Ltd. | - |
4 | ** Contact: http://www.qt.io/licensing/ | - |
5 | ** | - |
6 | ** This file is part of the QtWidgets module of the Qt Toolkit. | - |
7 | ** | - |
8 | ** $QT_BEGIN_LICENSE:LGPL21$ | - |
9 | ** Commercial License Usage | - |
10 | ** Licensees holding valid commercial Qt licenses may use this file in | - |
11 | ** accordance with the commercial license agreement provided with the | - |
12 | ** Software or, alternatively, in accordance with the terms contained in | - |
13 | ** a written agreement between you and The Qt Company. For licensing terms | - |
14 | ** and conditions see http://www.qt.io/terms-conditions. For further | - |
15 | ** information use the contact form at http://www.qt.io/contact-us. | - |
16 | ** | - |
17 | ** GNU Lesser General Public License Usage | - |
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - |
19 | ** General Public License version 2.1 or version 3 as published by the Free | - |
20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and | - |
21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the | - |
22 | ** following information to ensure the GNU Lesser General Public License | - |
23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and | - |
24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | - |
25 | ** | - |
26 | ** As a special exception, The Qt Company gives you certain additional | - |
27 | ** rights. These rights are described in The Qt Company LGPL Exception | - |
28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | - |
29 | ** | - |
30 | ** $QT_END_LICENSE$ | - |
31 | ** | - |
32 | ****************************************************************************/ | - |
33 | - | |
34 | #include "qstyleplugin.h" | - |
35 | #include "qstyle.h" | - |
36 | - | |
37 | QT_BEGIN_NAMESPACE | - |
38 | - | |
39 | /*! | - |
40 | \class QStylePlugin | - |
41 | \brief The QStylePlugin class provides an abstract base for custom QStyle plugins. | - |
42 | - | |
43 | \ingroup plugins | - |
44 | \inmodule QtWidgets | - |
45 | - | |
46 | QStylePlugin is a simple plugin interface that makes it easy | - |
47 | to create custom styles that can be loaded dynamically into | - |
48 | applications using the QStyleFactory class. | - |
49 | - | |
50 | Writing a style plugin is achieved by subclassing this base class, | - |
51 | reimplementing the pure virtual create() function, and | - |
52 | exporting the class using the Q_PLUGIN_METADATA() macro. | - |
53 | - | |
54 | \snippet qstyleplugin/main.cpp 0 | - |
55 | - | |
56 | The json metadata file \c mystyleplugin.json for the plugin needs | - |
57 | to contain information about the names of the styles the plugins | - |
58 | supports as follows: | - |
59 | - | |
60 | \quotefile qstyleplugin/mystyleplugin.json | - |
61 | - | |
62 | See \l {How to Create Qt Plugins} for details. | - |
63 | - | |
64 | \sa QStyleFactory, QStyle | - |
65 | */ | - |
66 | - | |
67 | /*! | - |
68 | \fn QStyle *QStylePlugin::create(const QString& key) | - |
69 | - | |
70 | Creates and returns a QStyle object for the given style \a key. | - |
71 | If a plugin cannot create a style, it should return 0 instead. | - |
72 | - | |
73 | The style key is usually the class name of the required | - |
74 | style. Note that the keys are case insensitive. For example: | - |
75 | - | |
76 | \snippet qstyleplugin/main.cpp 1 | - |
77 | */ | - |
78 | - | |
79 | /*! | - |
80 | Constructs a style plugin with the given \a parent. | - |
81 | - | |
82 | Note that this constructor is invoked automatically by the | - |
83 | moc generated code that exports the plugin, so there is no need for calling it | - |
84 | explicitly. | - |
85 | */ | - |
86 | QStylePlugin::QStylePlugin(QObject *parent) | - |
87 | : QObject(parent) | - |
88 | { | - |
89 | } never executed: end of block | 0 |
90 | - | |
91 | /*! | - |
92 | Destroys the style plugin. | - |
93 | - | |
94 | Note that Qt destroys a plugin automatically when it is no longer | - |
95 | used, so there is no need for calling the destructor explicitly. | - |
96 | */ | - |
97 | QStylePlugin::~QStylePlugin() | - |
98 | { | - |
99 | } | - |
100 | - | |
101 | QT_END_NAMESPACE | - |
102 | - | |
103 | #include "moc_qstyleplugin.cpp" | - |
Source code | Switch to Preprocessed file |