[Development] Q_PLUGIN_METADATA documentation
Giuseppe D'Angelo
dangelog at gmail.com
Tue Jun 25 08:09:38 CEST 2013
On 22 June 2013 00:14, Lorn Potter <lorn.potter at gmail.com> wrote:
>
> The documentation here:
> http://qt-project.org/doc/qt-5.0/qtcore/qtplugin.html#Q_PLUGIN_METADATA
>
> says nothing about the contents of the json file, what is possible for
> it to contain, what it should contain, or even it's purpose.
It's optional; it can contain any valid JSON. The idea is that you can
load that JSON and thus do some inquires about the plugin _without_
dlopening the plugin itself, by using QPluginLoader::metaData. For
instance, for an image plugin, you could figure out what are its
supported image formats without the need to load the plugin, create an
instance of some object and call some virtual method.
HTH,
--
Giuseppe D'Angelo
More information about the Development
mailing list