diff options
Diffstat (limited to 'src/corelib/doc/src/plugins-howto.qdoc')
-rw-r--r-- | src/corelib/doc/src/plugins-howto.qdoc | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/src/corelib/doc/src/plugins-howto.qdoc b/src/corelib/doc/src/plugins-howto.qdoc index 7fc4682fd4..7dc0d01cce 100644 --- a/src/corelib/doc/src/plugins-howto.qdoc +++ b/src/corelib/doc/src/plugins-howto.qdoc @@ -266,20 +266,46 @@ To link those plugins statically, you need to add the required plugins to your build using \c QTPLUGIN. - Q_IMPORT_PLUGIN() macros are also needed in application code, - but those are automatically generated by qmake and added to - your application project. In the \c .pro file for your application, you need the following entry: \snippet code/doc_src_plugins-howto.pro 5 + qmake automatically adds the plugins to QTPLUGIN that are typically + needed by the used Qt modules (see \c QT), while more specialized + plugins need to be added manually. + The default list of automatically added plugins can be overridden + per type. + For example, to link the minimal plugin instead of the default Qt + platform adaptation plugin, use: + + \snippet code/doc_src_plugins-howto.pro 4 + + If you want neither the default nor the minimal QPA plugin to be + linked automatically, use: + + \snippet code/doc_src_plugins-howto.pro 6 + + The defaults are tuned towards an optimal out-of-the-box experience, + but may unnecessarily bloat the application. + It is recommended to inspect the linker command line built by qmake + and eliminate unnecessary plugins. + + \section2 Details of Linking Static Plugins + + To cause static plugins actually being linked and instantiated, + Q_IMPORT_PLUGIN() macros are also needed in application code, + but those are automatically generated by qmake and added to + your application project. + If you do not want all plugins added to QTPLUGIN to be automatically linked, remove \c import_plugins from the \c CONFIG variable: \snippet code/doc_src_plugins-howto.pro 7 + \section2 Creating Static Plugins + It is also possible to create your own static plugins, by following these steps: @@ -298,17 +324,6 @@ to make sure that the \c{QT_STATICPLUGIN} preprocessor macro is defined. - The default Qt platform adaptation plugin is automatically added to QTPLUGIN - in static builds. If you want to add the minimal plugin instead, add \c qpa_minimal_plugin - to \c CONFIG: - - \snippet code/doc_src_plugins-howto.pro 4 - - If you want neither the default nor the minimal QPA plugin to be linked automatically, - remove \c import_qpa_plugin from \c CONFIG: - - \snippet code/doc_src_plugins-howto.pro 6 - \section1 Deploying and Debugging Plugins The \l{Deploying Plugins} document covers the process of deploying |