source: trunk/src/corelib/plugin/qplugin.qdoc@ 788

Last change on this file since 788 was 651, checked in by Dmitry A. Kuminov, 15 years ago

trunk: Merged in qt 4.6.2 sources.

  • Property svn:eol-style set to native
File size: 4.7 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4** All rights reserved.
5** Contact: Nokia Corporation ([email protected])
6**
7** This file is part of the documentation of the Qt Toolkit.
8**
9** $QT_BEGIN_LICENSE:LGPL$
10** Commercial Usage
11** Licensees holding valid Qt Commercial licenses may use this file in
12** accordance with the Qt Commercial License Agreement provided with the
13** Software or, alternatively, in accordance with the terms contained in
14** a written agreement between you and Nokia.
15**
16** GNU Lesser General Public License Usage
17** Alternatively, this file may be used under the terms of the GNU Lesser
18** General Public License version 2.1 as published by the Free Software
19** Foundation and appearing in the file LICENSE.LGPL included in the
20** packaging of this file. Please review the following information to
21** ensure the GNU Lesser General Public License version 2.1 requirements
22** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23**
24** In addition, as a special exception, Nokia gives you certain additional
25** rights. These rights are described in the Nokia Qt LGPL Exception
26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
27**
28** GNU General Public License Usage
29** Alternatively, this file may be used under the terms of the GNU
30** General Public License version 3.0 as published by the Free Software
31** Foundation and appearing in the file LICENSE.GPL included in the
32** packaging of this file. Please review the following information to
33** ensure the GNU General Public License version 3.0 requirements will be
34** met: http://www.gnu.org/copyleft/gpl.html.
35**
36** If you have questions regarding the use of this file, please contact
37** Nokia at [email protected].
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42/*!
43 \headerfile <QtPlugin>
44 \title Macros for Defining Plugins
45
46 \brief The <QtPlugin> header files defines macros for defining plugins.
47
48 \sa {How to Create Qt Plugins}
49*/
50
51/*!
52 \macro Q_DECLARE_INTERFACE(ClassName, Identifier)
53 \relates <QtPlugin>
54
55 This macro associates the given \a Identifier (a string literal)
56 to the interface class called \a ClassName. The \a Identifier must
57 be unique. For example:
58
59 \snippet examples/tools/plugandpaint/interfaces.h 3
60
61 This macro is normally used right after the class definition for
62 \a ClassName, in a header file. See the
63 \l{tools/plugandpaint}{Plug & Paint} example for details.
64
65 If you want to use Q_DECLARE_INTERFACE with interface classes
66 declared in a namespace then you have to make sure the Q_DECLARE_INTERFACE
67 is not inside a namespace though. For example:
68 \snippet doc/src/snippets/code/doc_src_qplugin.qdoc 0
69
70 \sa Q_INTERFACES(), Q_EXPORT_PLUGIN2(), {How to Create Qt Plugins}
71*/
72
73/*!
74 \macro Q_EXPORT_PLUGIN(ClassName)
75 \relates <QtPlugin>
76 \obsolete
77
78 Use Q_EXPORT_PLUGIN2() instead. This macro is equivalent to
79 Q_EXPORT_PLUGIN2(\a ClassName, \a ClassName).
80*/
81
82/*!
83 \macro Q_EXPORT_PLUGIN2(PluginName, ClassName)
84 \relates <QtPlugin>
85 \since 4.1
86 \keyword Q_EXPORT_PLUGIN2
87
88 This macro exports the plugin class \a ClassName for the plugin specified
89 by \a PluginName. The value of \a PluginName should correspond to the
90 \l{qmake Variable Reference#TARGET}{TARGET} specified in the plugin's
91 project file.
92
93 There should be exactly one occurrence of this macro in the source code
94 for a Qt plugin, and it should be used where the implementation is written
95 rather than in a header file.
96
97 Example:
98
99 \snippet doc/src/snippets/code/doc_src_qplugin.qdoc 1
100
101 See the \l{tools/plugandpaint}{Plug & Paint} example for details.
102
103 \sa Q_DECLARE_INTERFACE(), {How to Create Qt Plugins}
104*/
105
106/*!
107 \macro Q_IMPORT_PLUGIN(PluginName)
108 \relates <QtPlugin>
109
110 This macro imports the plugin named \a PluginName, corresponding
111 to the \l{qmake Variable Reference#TARGET}{TARGET} specified in the
112 plugin's project file.
113
114 Inserting this macro into your application's source code will allow
115 you to make use of a static plugin.
116
117 Example:
118
119 \snippet doc/src/snippets/code/doc_src_qplugin.qdoc 2
120
121 Static plugins must also be included by the linker when your
122 application is built. For Qt's predefined plugins,
123 you can use the \c QTPLUGIN to add
124 the required plugins to your build. For example:
125
126 \snippet doc/src/snippets/code/doc_src_qplugin.qdoc 3
127
128 \sa {Static Plugins}, {How to Create Qt Plugins}, {Using qmake}
129*/
130
131/*!
132 \macro Q_EXPORT_STATIC_PLUGIN(ClassName)
133 \relates <QtPlugin>
134 \internal
135*/
Note: See TracBrowser for help on using the repository browser.