Results 1 to 8 of 8

Thread: Plugin Help

  1. #1
    Join Date
    Jun 2010
    Posts
    142
    Thanks
    11
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Plugin Help

    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?
    Attached Files Attached Files

  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: Plugin Help

    So what doesn't work exactly?
    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
    Jun 2010
    Posts
    142
    Thanks
    11
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Plugin Help

    QPluginLoader returns NULL when I open the plugin.

  4. #4
    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: Plugin Help

    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".
    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.


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

    MTK358 (18th April 2011)

  6. #5
    Join Date
    Jun 2010
    Posts
    142
    Thanks
    11
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Plugin Help

    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...

  7. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Plugin Help

    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).

  8. #7
    Join Date
    Jun 2010
    Posts
    142
    Thanks
    11
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Plugin Help

    I used Q_EXPORT_PLUGIN2.

  9. #8
    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: Plugin Help

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


Similar Threads

  1. Replies: 7
    Last Post: 11th April 2013, 10:55
  2. Replies: 1
    Last Post: 8th October 2010, 11:38
  3. Plugin and shared class between plugin and application
    By wishper in forum Qt Programming
    Replies: 7
    Last Post: 23rd August 2010, 17:00
  4. Plugin to Plugin (lib) dependency
    By Wali in forum Newbie
    Replies: 2
    Last Post: 10th June 2010, 10:55
  5. Replies: 0
    Last Post: 16th September 2009, 02:33

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.