Plugin manager with the option to enable and disable



  • I'm studying in order to create a plugin manager, where I list all the plugins in a list view and create a custom delegate to draw a checkbox to enable and disable a plugin.
    I'm only studying codes and I figured a few things out but there's something that is kinda hard for me to understand right now.
    The plugin manager uses QPluginLoader and the method load, but I was wondering if the method unload is going to be necessary here in order to disable a plugin when the user hits the checkbox to disable a plugin.
    What would be the best approach to create something like this? If I call unload I will have to call load again right? Is it really necessary or I can create something that I don't actually need to unload but only disable?
    If you have open source softwares using Qt that uses any plugin manager approach, please send me so I can study the source code and understand a little but, it doesn't need to have every single feature, any code will come in handy.


  • Lifetime Qt Champion

    Hi,

    Qt Creator is such an application.



  • Yes, you are right, it should help, I'll be looking into Qt Creator's source code.


  • Moderators

    @Mr-Gisa said in Plugin manager with the option to enable and disable:

    What would be the best approach to create something like this? If I call unload I will have to call load again right? Is it really necessary or I can create something that I don't actually need to unload but only disable?

    it's up to you. You can unload it or 'disable' it by simply not using the the interface provided by the plugin in your application.



  • @raven-worx Like creating a setting for each plugin and one called "enabled" and before usnig it I check if it's true or not, right?
    I think that the "unload" is kinda overhead cause I would need to load again in the memory, idk.


  • Moderators

    @Mr-Gisa said in Plugin manager with the option to enable and disable:

    @raven-worx Like creating a setting for each plugin and one called "enabled" and before usnig it I check if it's true or not, right?

    yes, something like that.
    I wouldn't "overcomplicate" it.

    Depending on the count and size of the plugins you could also load all found plugins beforehand to quickly en-/disable them during runtime.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.