Results 1 to 6 of 6

Thread: multiple designer plugin in one DLL.

  1. #1
    Join Date
    Nov 2008
    Posts
    12
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy multiple designer plugin in one DLL.

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: multiple designer plugin in one DLL.

    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Nov 2008
    Posts
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: multiple designer plugin in one DLL.

    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

  4. #4
    Join Date
    Mar 2009
    Posts
    9
    Thanks
    1

    Default Re: multiple designer plugin in one DLL.

    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

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: multiple designer plugin in one DLL.

    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. The following user says thank you to wysota for this useful post:

    miroslav_karpis (11th March 2009)

  7. #6
    Join Date
    Mar 2009
    Posts
    9
    Thanks
    1

    Default Re: multiple designer plugin in one DLL.

    Quote Originally Posted by wysota View Post
    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

Similar Threads

  1. problem loading custom plugin on Qt Designer 4
    By raman_31181 in forum Qt Tools
    Replies: 18
    Last Post: 26th September 2008, 09:42
  2. Qt designer plugin errors on OSX Leopard
    By mpotocnik in forum Qt Tools
    Replies: 10
    Last Post: 21st January 2008, 09:45
  3. QPluginLoader not recognizing a plugin
    By KShots in forum Qt Programming
    Replies: 3
    Last Post: 29th June 2007, 14:13
  4. Qt Designer plugin on windows
    By big4mil in forum Newbie
    Replies: 4
    Last Post: 30th May 2007, 17:33
  5. Replies: 13
    Last Post: 15th December 2006, 11:52

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.