summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-05-27 03:04:44 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-06 02:02:46 +0200
commit9ca509676f3e7a4c19aded98c59990a779a4a052 (patch)
treee62c1b3fb8cb5125e99744040bddeb189bab96cf /src
parent044e2b326231728c0a90482c8896a8c3bad203d6 (diff)
Update of the plugin documentation
Moved the plugin overview from qtdoc to qtbase. Updated the docs to describe the new plugin mechanism. Change-Id: I1b92d5099aeaa3a166c1f7698176d811d47c3392 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/doc/snippets/code/doc_src_qplugin.cpp5
-rw-r--r--src/corelib/plugin/qplugin.qdoc37
2 files changed, 15 insertions, 27 deletions
diff --git a/src/corelib/doc/snippets/code/doc_src_qplugin.cpp b/src/corelib/doc/snippets/code/doc_src_qplugin.cpp
index 1577b2fa61..e07d888dee 100644
--- a/src/corelib/doc/snippets/code/doc_src_qplugin.cpp
+++ b/src/corelib/doc/snippets/code/doc_src_qplugin.cpp
@@ -49,7 +49,10 @@ Q_DECLARE_INTERFACE(Foo::MyInterface, "org.examples.MyInterface")
//! [1]
-Q_EXPORT_PLUGIN2(pnp_extrafilters, ExtraFiltersPlugin)
+class MyInstance : public QObject
+{
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDummyPlugin" FILE "mymetadata.json")
+};
//! [1]
diff --git a/src/corelib/plugin/qplugin.qdoc b/src/corelib/plugin/qplugin.qdoc
index 001b0d5932..f671a5f1a4 100644
--- a/src/corelib/plugin/qplugin.qdoc
+++ b/src/corelib/plugin/qplugin.qdoc
@@ -27,9 +27,10 @@
/*!
\headerfile <QtPlugin>
- \title Macros for Defining Plugins
+ \title Defining Plugins
+ \ingroup plugins
- \brief The <QtPlugin> header files defines macros for defining plugins.
+ \brief The <QtPlugin> header file defines macros for defining plugins.
\sa {How to Create Qt Plugins}
*/
@@ -53,32 +54,22 @@
is not inside a namespace though. For example:
\snippet code/doc_src_qplugin.cpp 0
- \sa Q_INTERFACES(), Q_EXPORT_PLUGIN2(), {How to Create Qt Plugins}
+ \sa Q_INTERFACES(), {How to Create Qt Plugins}
*/
/*!
- \macro Q_EXPORT_PLUGIN(ClassName)
+ \macro Q_PLUGIN_METADATA(...)
\relates <QtPlugin>
- \obsolete
+ \since 5.0
- Use Q_EXPORT_PLUGIN2() instead. This macro is equivalent to
- Q_EXPORT_PLUGIN2(\a ClassName, \a ClassName).
-*/
-
-/*!
- \macro Q_EXPORT_PLUGIN2(PluginName, ClassName)
- \relates <QtPlugin>
- \since 4.1
- \keyword Q_EXPORT_PLUGIN2
+ This macro is being used to declare meta data that is part of a plugin
+ that instantiates this object.
- This macro exports the plugin class \a ClassName for the plugin specified
- by \a PluginName. The value of \a PluginName should correspond to the
- \l{qmake Variable Reference#TARGET}{TARGET} specified in the plugin's
- project file.
+ The macro needs to declare the IID of the interface implemented through
+ the object, and reference a file containing the meta data for the plugin.
There should be exactly one occurrence of this macro in the source code
- for a Qt plugin, and it should be used where the implementation is written
- rather than in a header file.
+ for a Qt plugin.
Example:
@@ -113,9 +104,3 @@
\sa {Static Plugins}, {How to Create Qt Plugins}, {Using qmake}
*/
-
-/*!
- \macro Q_EXPORT_STATIC_PLUGIN(ClassName)
- \relates <QtPlugin>
- \internal
-*/