|Toggle details||Q_DECLARE_INTERFACEQ_DECLARE_INTERFACE ( ClassName , Identifier )|
This macro associates the given Identifier (a string literal) to the interface class called ClassName. The Identifier must be unique. For example:
This macro is normally used right after the class definition for ClassName, in a header file. See the Plug & Paint example for details.
If you want to use Q_DECLARE_INTERFACE with interface classes declared in a namespace then you have to make sure the Q_DECLARE_INTERFACE is not inside a namespace though. For example:
|Toggle details||Q_EXPORT_PLUGIN2Q_EXPORT_PLUGIN2 ( PluginName , ClassName )|
This macro exports the plugin class ClassName for the plugin specified by PluginName. The value of PluginName should correspond to the TARGET specified in the plugin's project file.
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.
See the Plug & Paint example for details.
|Toggle details||Q_IMPORT_PLUGINQ_IMPORT_PLUGIN ( PluginName )|
This macro imports the plugin named PluginName, corresponding to the TARGET specified in the plugin's project file.
Inserting this macro into your application's source code will allow you to make use of a static plugin.
Static plugins must also be included by the linker when your application is built. For Qt's predefined plugins, you can use the QTPLUGIN to add the required plugins to your build. For example:
|Toggle details||Q_EXPORT_PLUGINQ_EXPORT_PLUGIN ( ClassName )|