PDA

View Full Version : multiple designer plugin in one DLL.



janEUcitzen
9th March 2009, 11:02
Hi.

I am trying to develop a couple of plugins for QtDesigner 4.4.1 and 4.5.

It all works when I put each plugin in a seperate DLL, but when I put all plugins in the same DLL I get a link problem "qt_plugin_instance_xxx" is multiple defined.

this is due to the Q_EXPORT_PLUGIN2 macro.

I have tried to "split" the macro, but with the same result.

Does anyone have experience with multiple plugins in a single dll ?

thanks in advance.
Jan I

wysota
10th March 2009, 01:05
If we are talking about Designer widget plugins, you need to use Q_EXPORT_PLUGIN2 macro only with QDesignerCustomWidgetCollectionInterface subclass. Individual widget "plugins" don't need to (and even shouldn't) be exported. The collection will handle everything if you implement it correctly.

janEUcitzen
10th March 2009, 08:21
Thanks for the hint it helped me.

I have about 10 designer widgets I wanted to put in 1 dll.

have a nice day
jan

miroslav_karpis
11th March 2009, 07:50
I don't know if this the right place but:
I have also made one custom widget plugin for Designer but I have a troubles to implement it (use it). It appears in designer I can also move and place to MainWindow form. Compilation is OK but when I want to run I get this error:
"error while loading shared libraries: libworldtimeclockplugin.so: cannot open shared object file: No such file or directory"

The path to the library is correct because of "make" run without errors.

Please can you post here a short example of how you use the widgets in designer? It would really help me a lot ;)

wysota
11th March 2009, 11:15
Your issue is not related to Designer. The problem is that your application has to link with the code of the widget you are trying to use. And to do that, the library has to be found by the dynamic linker not only at compile time, but also during run time. You have to place the library in a path where linker will be looking for it. You can use the LD_LIBRARY_PATH variable to extend the linker lookup path if you need to.

miroslav_karpis
11th March 2009, 11:41
Your issue is not related to Designer. The problem is that your application has to link with the code of the widget you are trying to use. And to do that, the library has to be found by the dynamic linker not only at compile time, but also during run time. You have to place the library in a path where linker will be looking for it. You can use the LD_LIBRARY_PATH variable to extend the linker lookup path if you need to.


millions + millions thanks for that