QtBase: Docs: remove deprecated Q_EXPORT_PLUGIN2

... and add description for Q_PLUGIN_METADATA

Change-Id: Ie389787df53d3cdfa27ba8fb0e77f32df1597c4f
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
This commit is contained in:
David Schulz 2012-11-30 09:28:11 +01:00 committed by The Qt Project
parent 5ce64dd750
commit 4cbe999921

View File

@ -145,11 +145,13 @@
plugin. The Q_INTERFACES macro tells Qt which interfaces the class
implements. In our case we only implement the \c EchoInterface.
If a class implements more than one interface, they are given as
a comma separated list.
a comma separated list. The Q_PLUGIN_METADATA macro is included next
to the Q_OBJECT macro. It contains the plugins IID and a filename
pointing to a json file containing the metadata for the plugin.
The json file is compiled into the plugin and does not need to be installed.
\snippet tools/echoplugin/plugin/echoplugin.h 0
\section1 EchoPlugin Class Implementation
Here is the implementation of \c echo():
@ -158,13 +160,6 @@
We simply return the functions parameter.
\snippet tools/echoplugin/plugin/echoplugin.cpp 1
We use the Q_EXPORT_PLUGIN2 macro to let Qt know that the \c
EchoPlugin class is a plugin. The first parameter is the name of
the plugin; it is usual to give the plugin and the library file it
is stored in the same name.
\section1 The \c main() function
\snippet tools/echoplugin/echowindow/main.cpp 0