From 88b68964befccfa99b19e45c44cd0b0e60939a01 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 7 Dec 2012 10:47:00 +0100 Subject: [PATCH] Doc: Replace outdated macro from docs Change-Id: I525c1322a46115f64fe94d48a0ebc2d4fb2e2e12 Reviewed-by: Jerome Pasion --- examples/designer/doc/src/containerextension.qdoc | 4 ++-- examples/designer/doc/src/customwidgetplugin.qdoc | 4 ++-- examples/designer/doc/src/taskmenuextension.qdoc | 4 ++-- examples/designer/doc/src/worldtimeclockplugin.qdoc | 6 +++--- examples/designer/worldtimeclockplugin/worldtimeclockplugin.h | 2 ++ src/designer/src/designer/doc/src/designer-manual.qdoc | 2 +- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/examples/designer/doc/src/containerextension.qdoc b/examples/designer/doc/src/containerextension.qdoc index 8d4b5af..c97b028 100644 --- a/examples/designer/doc/src/containerextension.qdoc +++ b/examples/designer/doc/src/containerextension.qdoc @@ -101,7 +101,7 @@ The \c TEMPLATE variable's value makes \c qmake create the custom widget as a library. Later, we will ensure that the widget will be - recognized as a plugin by Qt by using the Q_EXPORT_PLUGIN2() macro + recognized as a plugin by Qt by using the Q_PLUGIN_METADATA() macro to export the relevant widget information. The \c CONFIG variable contains two values, \c designer and \c @@ -346,7 +346,7 @@ \snippet containerextension/multipagewidgetplugin.cpp 14 - Remember to use the Q_EXPORT_PLUGIN2() macro to export the + Remember to use the Q_PLUGIN_METADATA() macro to export the MultiPageWidgetPlugin class for use with Qt's plugin handling classes: This macro ensures that \QD can access and construct the custom widget. Without this macro, there is no way for \QD to use diff --git a/examples/designer/doc/src/customwidgetplugin.qdoc b/examples/designer/doc/src/customwidgetplugin.qdoc index a1b945f..3206136 100644 --- a/examples/designer/doc/src/customwidgetplugin.qdoc +++ b/examples/designer/doc/src/customwidgetplugin.qdoc @@ -53,7 +53,7 @@ The \c TEMPLATE variable's value makes \c qmake create the custom widget as a library. Later, we will ensure that the widget will be - recognized as a plugin by Qt by using the Q_EXPORT_PLUGIN2() macro + recognized as a plugin by Qt by using the Q_PLUGIN_METADATA() macro to export the relevant widget information. The \c CONFIG variable contains two values, \c designer and \c @@ -95,7 +95,7 @@ alongside the other \QD plugins when the project is installed (using \c{make install} or an equivalent installation procedure). Later, we will ensure that it is recognized as a plugin by \QD by - using the Q_EXPORT_PLUGIN2() macro to export the relevant widget + using the Q_PLUGIN_METADATA() macro to export the relevant widget information. Note that if you want the plugins to appear in a Visual Studio diff --git a/examples/designer/doc/src/taskmenuextension.qdoc b/examples/designer/doc/src/taskmenuextension.qdoc index 6747618..e6dcae3 100644 --- a/examples/designer/doc/src/taskmenuextension.qdoc +++ b/examples/designer/doc/src/taskmenuextension.qdoc @@ -101,7 +101,7 @@ The \c TEMPLATE variable's value makes \c qmake create the custom widget as a library. Later, we will ensure that the widget will be - recognized as a plugin by Qt by using the Q_EXPORT_PLUGIN2() macro to + recognized as a plugin by Qt by using the Q_PLUGIN_METADATA() macro to export the relevant widget information. The \c CONFIG variable contains two values, \c designer and \c @@ -254,7 +254,7 @@ \snippet taskmenuextension/tictactoeplugin.cpp 4 - Finally, we use the Q_EXPORT_PLUGIN2() macro to export the + Finally, we use the Q_PLUGIN_METADATA() macro to export the TicTacToePlugin class for use with Qt's plugin handling classes: This macro ensures that \QD can access and construct the custom widget. Without this macro, there is no way for \QD to use the diff --git a/examples/designer/doc/src/worldtimeclockplugin.qdoc b/examples/designer/doc/src/worldtimeclockplugin.qdoc index 10eca79..58770a4 100644 --- a/examples/designer/doc/src/worldtimeclockplugin.qdoc +++ b/examples/designer/doc/src/worldtimeclockplugin.qdoc @@ -129,10 +129,10 @@ {customwidgetplugin}{Custom Widget Plugin} example (only the class name and the implementation of QDesignerCustomWidgetInterface::domXml() differ). The main thing - to remember is to use the Q_EXPORT_PLUGIN2() macro to export the \c + to remember is to use the Q_PLUGIN_METADATA() macro to export the \c WorldTimeClockPlugin class for use with \QD: - \snippet worldtimeclockplugin/worldtimeclockplugin.cpp 0 + \snippet worldtimeclockplugin/worldtimeclockplugin.h 1 Without this macro, there is no way for Qt Designer to use the widget. @@ -182,7 +182,7 @@ alongside the other \QD plugins when the project is installed (using \c{make install} or an equivalent installation procedure). Later, we will ensure that it is recognized as a plugin by \QD by - using the Q_EXPORT_PLUGIN2() macro to export the relevant widget + using the Q_PLUGIN_METADATA() macro to export the relevant widget information. Note that if you want the plugins to appear in a Visual Studio diff --git a/examples/designer/worldtimeclockplugin/worldtimeclockplugin.h b/examples/designer/worldtimeclockplugin/worldtimeclockplugin.h index 753c94a..2973af7 100644 --- a/examples/designer/worldtimeclockplugin/worldtimeclockplugin.h +++ b/examples/designer/worldtimeclockplugin/worldtimeclockplugin.h @@ -48,7 +48,9 @@ class WorldTimeClockPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT +//! [1] Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDesignerCustomWidgetInterface" FILE "worldtimeclock.json") +//! [1] Q_INTERFACES(QDesignerCustomWidgetInterface) public: diff --git a/src/designer/src/designer/doc/src/designer-manual.qdoc b/src/designer/src/designer/doc/src/designer-manual.qdoc index b3d15a6..834339e 100644 --- a/src/designer/src/designer/doc/src/designer-manual.qdoc +++ b/src/designer/src/designer/doc/src/designer-manual.qdoc @@ -2501,7 +2501,7 @@ pixmap property in the property editor. that they export the symbols needed by \QD. First of all, the plugin class must be exported in order for the plugin to - be loaded by \QD. Use the Q_EXPORT_PLUGIN2() macro to do this. Also, the + be loaded by \QD. Use the Q_PLUGIN_METADATA() macro to do this. Also, the QDESIGNER_WIDGET_EXPORT macro must be used to define each custom widget class within a plugin, that \QD will instantiate. -- 2.7.4