PDA

View Full Version : Plugin Help



MTK358
17th April 2011, 22: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
18th April 2011, 00:06
So what doesn't work exactly?

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

wysota
18th April 2011, 01: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, 02: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, 03: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, 03:31
I used Q_EXPORT_PLUGIN2.

wysota
18th April 2011, 12: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.