PDA

View Full Version : Plugin Help



MTK358
17th April 2011, 21:33
I read all I can and posted other questions in different places before, but I cannot get Qt plugins to work.

I made a really simple example (attached) and it doesn't work. Could someone tell me what's wrong?

wysota
17th April 2011, 23:06
So what doesn't work exactly?

MTK358
18th April 2011, 00:01
QPluginLoader returns NULL when I open the plugin.

wysota
18th April 2011, 00:05
If I'm not mistaken Q_EXPORT_PLUGIN should be in the cpp file and not in the header file. Furthermore the name exported has to correspond with the plugin target name, in your case it should be "test-plugin" and not "mytestplugin".

MTK358
18th April 2011, 01:19
Finally, it works!

I just wish I didn't have to ask over 10 times in different places over the last few weeks to find this out...

ChrisW67
18th April 2011, 02:12
The documentation for Q_EXPORT_PLUGIN advises that this macro is deprecated and directs you to use Q_EXPORT_PLUGIN2. The information regarding placement of the Q_EXPORT_PLUGIN2 macro in the implementation file is in the Qt documentation for Q_EXPORT_PLUGIN2 (See QtPlugin).

MTK358
18th April 2011, 02:31
I used Q_EXPORT_PLUGIN2.

wysota
18th April 2011, 11:04
I just wish I didn't have to ask over 10 times in different places over the last few weeks to find this out...
Well... can't help you with that much. It's your decision where you ask your questions.