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 usesQPluginLoader
and the methodload
, but I was wondering if the methodunload
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 callunload
I will have to callload
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. -
Hi,
Qt Creator is such an application.
-
@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. -
@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.