How to make plugins configurable?
-
I have a
PluginManagerwhere searches for plugins in a folder, load usingQPluginLoaderputs in aQHash<QString, QPluginLoader *>theQStringhas the classname taken from theQPluginLoader::metaData.
ThePluginManagerhas a method calledinitializePluginswhere has aforeachgetting the instance of each plugin usingqobject_castand calling the methodinitializeof the plugin.The idea I want to implement? The plugins are websites, for example:
rapidgator.comand I need login and password information from the user.
I want to implement a kind of listing of the plugins found in a window, maybe in a configuration part of the system, maybe it could help, but I have no idea what I can do.
How to make plugins configurable? Each plugin can have configuration individually? -
I have a
PluginManagerwhere searches for plugins in a folder, load usingQPluginLoaderputs in aQHash<QString, QPluginLoader *>theQStringhas the classname taken from theQPluginLoader::metaData.
ThePluginManagerhas a method calledinitializePluginswhere has aforeachgetting the instance of each plugin usingqobject_castand calling the methodinitializeof the plugin.The idea I want to implement? The plugins are websites, for example:
rapidgator.comand I need login and password information from the user.
I want to implement a kind of listing of the plugins found in a window, maybe in a configuration part of the system, maybe it could help, but I have no idea what I can do.
How to make plugins configurable? Each plugin can have configuration individually?@Defohin What about http://doc.qt.io/qt-5/qsettings.html ?
-
@Defohin What about http://doc.qt.io/qt-5/qsettings.html ?
@jsulm
QSettingswill help me to save the settings, but that is not what I'm actually asking here, but how to ask for the user for the login and password, or another configuration.
I thought about creating a window with all the plugins listed and when you click or something like that the configurations for that plugin appears!?
I'm not worried about saving the configurations, but how to provide different configurations for different plugins where the user can specify then somewhere. -
Hi,
Make the configuration part of your plugin by e.g. making it provide a configuration widget.
-
Hi,
Make the configuration part of your plugin by e.g. making it provide a configuration widget.
-
Well, it boils down to adding a method to your plugin interface called e.g.
virtual QWidget *configurationWidget() const = 0;and in your plugins, you reimplement it to return a QWidget based widget that provides a panel that allows to modify whatever plugin specific settings you may need. -
Well, it boils down to adding a method to your plugin interface called e.g.
virtual QWidget *configurationWidget() const = 0;and in your plugins, you reimplement it to return a QWidget based widget that provides a panel that allows to modify whatever plugin specific settings you may need.