[SOLVED]Qt Plugin metadata
-
Hi,
Did you dump the content of pluginLoader.metaData() ?
I just tried with a simple plugin and got the value of name using:
@pluginLoader.metaData().value("MetaData").toObject().value("name").toString();@Also don't forget to "touch" the plugin header file before rebuilding to take the json file modifications in account.
-
As AGalst suggested, you forget the key "MetaData" if you want to get access the json file contents passed in the Q_PLUGIN_METADATA. Other information such as IID can be access through the key "IID" etc.
-
Thanks a lot guys, it works fine.
I wonder does this info mentioned in Qt docs?
-
You're welcome !
From the ones I searched through, no, this call for an update to the documentation
-
[quote]From the ones I searched through, no, this call for an update to the documentation[/quote]
Usually I create wiki page for missing docs but because I haven't the suitable knowledge about Qt Plugins, May you please create a wiki page.
-
Correction to the doc would have a wider impact. Can you point me to your wiki entries so I can see what would be a good addition to the official documentation ?
-
bq. Can you point me to your wiki entries
I didn't write any entries I just suggested to add them by you.
-
For the quick road, I have added a doc note
-
[quote author="SGaist" date="1375821248"]For the quick road, I have added a doc note[/quote]
Thanks a lot :)
-
Definately much appreciated. I was trying to use the new metadata interface for the same reasons, and found the same lack of details in the docs. I have my own implementation working properly now (thanks to this thread), but it would be nice to have some references in the docs about this metadata and json structure.