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

Last change on this file since 1023 was 846, checked in by Dmitry A. Kuminov, 14 years ago

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

  • Property svn:eol-style set to native
File size: 3.8 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2011 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:FDL$
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 a
14** written agreement between you and Nokia.
15**
16** GNU Free Documentation License
17** Alternatively, this file may be used under the terms of the GNU Free
18** Documentation License version 1.3 as published by the Free Software
19** Foundation and appearing in the file included in the packaging of this
20** file.
21**
22** If you have questions regarding the use of this file, please contact
23** Nokia at [email protected].
24** $QT_END_LICENSE$
25**
26****************************************************************************/
27
28/*!
29 \headerfile <QtPlugin>
30 \title Macros for Defining Plugins
31
32 \brief The <QtPlugin> header files defines macros for defining plugins.
33
34 \sa {How to Create Qt Plugins}
35*/
36
37/*!
38 \macro Q_DECLARE_INTERFACE(ClassName, Identifier)
39 \relates <QtPlugin>
40
41 This macro associates the given \a Identifier (a string literal)
42 to the interface class called \a ClassName. The \a Identifier must
43 be unique. For example:
44
45 \snippet examples/tools/plugandpaint/interfaces.h 3
46
47 This macro is normally used right after the class definition for
48 \a ClassName, in a header file. See the
49 \l{tools/plugandpaint}{Plug & Paint} example for details.
50
51 If you want to use Q_DECLARE_INTERFACE with interface classes
52 declared in a namespace then you have to make sure the Q_DECLARE_INTERFACE
53 is not inside a namespace though. For example:
54 \snippet doc/src/snippets/code/doc_src_qplugin.qdoc 0
55
56 \sa Q_INTERFACES(), Q_EXPORT_PLUGIN2(), {How to Create Qt Plugins}
57*/
58
59/*!
60 \macro Q_EXPORT_PLUGIN(ClassName)
61 \relates <QtPlugin>
62 \obsolete
63
64 Use Q_EXPORT_PLUGIN2() instead. This macro is equivalent to
65 Q_EXPORT_PLUGIN2(\a ClassName, \a ClassName).
66*/
67
68/*!
69 \macro Q_EXPORT_PLUGIN2(PluginName, ClassName)
70 \relates <QtPlugin>
71 \since 4.1
72 \keyword Q_EXPORT_PLUGIN2
73
74 This macro exports the plugin class \a ClassName for the plugin specified
75 by \a PluginName. The value of \a PluginName should correspond to the
76 \l{qmake Variable Reference#TARGET}{TARGET} specified in the plugin's
77 project file.
78
79 There should be exactly one occurrence of this macro in the source code
80 for a Qt plugin, and it should be used where the implementation is written
81 rather than in a header file.
82
83 Example:
84
85 \snippet doc/src/snippets/code/doc_src_qplugin.qdoc 1
86
87 See the \l{tools/plugandpaint}{Plug & Paint} example for details.
88
89 \sa Q_DECLARE_INTERFACE(), {How to Create Qt Plugins}
90*/
91
92/*!
93 \macro Q_IMPORT_PLUGIN(PluginName)
94 \relates <QtPlugin>
95
96 This macro imports the plugin named \a PluginName, corresponding
97 to the \l{qmake Variable Reference#TARGET}{TARGET} specified in the
98 plugin's project file.
99
100 Inserting this macro into your application's source code will allow
101 you to make use of a static plugin.
102
103 Example:
104
105 \snippet doc/src/snippets/code/doc_src_qplugin.qdoc 2
106
107 Static plugins must also be included by the linker when your
108 application is built. For Qt's predefined plugins,
109 you can use the \c QTPLUGIN to add
110 the required plugins to your build. For example:
111
112 \snippet doc/src/snippets/code/doc_src_qplugin.qdoc 3
113
114 \sa {Static Plugins}, {How to Create Qt Plugins}, {Using qmake}
115*/
116
117/*!
118 \macro Q_EXPORT_STATIC_PLUGIN(ClassName)
119 \relates <QtPlugin>
120 \internal
121*/
Note: See TracBrowser for help on using the repository browser.