Results 1 to 3 of 3

Thread: [SOLVED] Q_EXPORT_PLUGIN2 vs. $$qtLibraryTarget()

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2006
    Posts
    81
    Thanks
    6
    Thanked 5 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Question [SOLVED] Q_EXPORT_PLUGIN2 vs. $$qtLibraryTarget()

    Hi all,

    I have a plugin foo that I build to TARGET = $$qtLibraryTarget(foo). This implies that under Windows, the debug plugin is named food.dll (mark the trailing 'd' character).

    I use Q_EXPORT_PLUGIN2(PluginName, FooClass) to export the plugin class. As the doc states:
    The value of PluginName should correspond to the TARGET specified in the plugin's project file.
    So the 1st parameter to Q_EXPORT_PLUGIN2 needs to fit the appropriate build configuration.
    Of course I could use #ifdef to preprocess with a different macro parameter depending on the configuration. However, I dislike this option as it requires manual synchronization between plugin implementation source and .pro file.

    Is there a better way to automagically adopt Q_EXPORT_PLUGIN2's PluginName to the TARGET?

    Thank you for your help and proposals.
    Last edited by zaphod.b; 24th July 2009 at 14:42.

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.