Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to set Q_PLUGIN_METADATA when a plugin supports several interfaces.
Qt 6.12 LTS is out! See what's new in the release blog

How to set Q_PLUGIN_METADATA when a plugin supports several interfaces.

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lolo67
    wrote on last edited by Lolo67
    #1

    Supposing I have the following interfaces iid in a application that can be extended through plugins

    #define Interface1_iid “myorganisation.com.application.interface1_rev_1.0”
    #define Interface2_iid “myorganisation.com.application.interface2_rev_2.0”
    

    In an earlier version of the application Interface2 was declared as revision 1.0

    Now supposing I have a plugin that supports several interfaces:

    class thisPlugin : 
      public Q_OBJECT,
      public Interface1,
      public Interface2 
    
    {
      Q_OBJECT
      Q_PLUGIN_METADATA(???)
      Q_INTERFACES(Interface1 Interface2)
    

    How I am supposed to set Q_PLUGIN_METADATA if the plugin is supporting Interface1 in revision 1.0 and Interface2 in revision 2.0 ... note that I might have an older version of the plugin that is supporting Interface1 in revision 1.0 and Interface2 in revision 1.0

    The Q_PLUGIN_METADATA macro needs to declare the IID of the interface implemented through the object, and reference a file containing the meta data for the plugin. Problem is that the plugin supports 2 interfaces and that the macro can declare only 1 IID from one of both interfaces. Also there should be exactly one occurrence of the Q_PLUGIN_METADATA macro in the source code for a Qt plugin.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by SGaist
      #2

      Hi and welcome to devnet,

      I'd recommend bringing this topic to the interest mailing list. You'll find there Qt's developers/maintainers. This forum is more user oriented.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt
      • Unsolved