Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QPlugin inter Dependency
Qt 6.12 LTS is out! See what's new in the release blog

QPlugin inter Dependency

Scheduled Pinned Locked Moved General and Desktop
qpluginloaderplugincompilation
2 Posts 2 Posters 1.9k Views 2 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.
  • S Offline
    S Offline
    Suths
    wrote on last edited by Suths
    #1

    Hi,

    I have two plugins that are dynamically linked and are loaded by QPluginLoader which is contained with the main project. I have created a method to ensure that if plugins have a dependency on another plugin that the plugins are loaded in the correct order to satisfy their dependencies.

    Loading of plugin:
    QPluginLoader pluginLoader(itor->PluginPath); QObject *tempPlugin = pluginLoader.instance();

    Plugin one:
    #include "PluginInterface.h"
    class NewWizardPlugin: public PluginInterface
    {
    Q_OBJECT
    Q_PLUGIN_METADATA(IID "Code.PluginInterface" FILE "NewViewPlugin.json")
    Q_INTERFACES(PluginInterface)
    public:
    NewWizardPlugin();

      virtual ~NewWizardPlugin();
    

    };

    Plugin Two
    ``
    #include "PluginInterface.h"
    #include "NewWizardPlugin.h"
    class newStandardSubwizard: public PluginInterface
    {
    Q_OBJECT
    Q_PLUGIN_METADATA(IID "Code.PluginInterface" FILE "New_standard_subwizard.json")
    Q_INTERFACES(PluginInterface)
    public:

      newStandardSubwizard();
    
      virtual ~newStandardSubwizard();
    };
    

    ``

    Now depending on what I do next one of two things happen.
    If i just reference the header file of the other plugin as done above in the header file I get a symbolic link error from the QPluginLoader. Or if I add the header ("NewWizardPlugin.h") to the include headers of the .pro file for the newStandardSubwizard plugin, I get moc errors. Has anyone done this before, can offer any ideas, i'm fairly stuck on this.

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

      Hi,

      For the interface part, you could have a common library that offers all the interfaces (e.g. MyAbstractPluginInterface) that your plugin will use and link to that library.

      Hope it helps

      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