Workspace 6.21.5
Signals | Public Member Functions | Protected Member Functions | List of all members
PluginConfig Class Referenceabstract

Provider of a QWidget for configuring a plugin. You can use the Developer wizard to generate a stub implementation of this class. See Integrating a custom plugin settings widget into the Workspace Editor.

#include <Workspace/Application/Plugins/pluginconfig.h>

Inheritance diagram for PluginConfig:
[legend]

Signals

void modified ()
 

Public Member Functions

virtual void applyConfig ()=0
 
virtual void destroy ()=0
 
virtual QWidget & getQWidget ()=0
 
virtual bool isTopLevelConfig () const
 
virtual void resetConfig ()=0
 

Protected Member Functions

 ~PluginConfig () override=default
 

Constructor & Destructor Documentation

◆ ~PluginConfig()

~PluginConfig ( )
overrideprotecteddefault

Only subclasses may delete PluginConfig objects, and it should always be from inside destroy().

Member Function Documentation

◆ applyConfig()

virtual void applyConfig ( )
pure virtual

Subclasses must implement this function to take whatever action is necessary to apply any changes made to them. This will normally be to update the plugin's relevant settings obtained from Settings::getPluginSettings(), but subclasses would not normally call Settings::save(). Rather, it is assumed that whatever created this PluginConfig object will do so at the relevant time (usually after calling applyConfig() on all loaded plugins).

Implemented in RemoteExecutionSettingsPluginConfig, RenderingSettingsPluginConfig, and EmptyPluginConfig.

◆ destroy()

virtual void destroy ( )
pure virtual

Subclasses will almost always implement this function simply as a call to the delete operator, or to some kind of factory singleton which does this. Since PluginConfig subclass objects are usually instantiated by a singleton within the plugin, the destroy() function is necessary to ensure that the plugin also deletes instances.

Implemented in RemoteExecutionSettingsPluginConfig, RenderingSettingsPluginConfig, and EmptyPluginConfig.

◆ getQWidget()

virtual QWidget & getQWidget ( )
pure virtual
Returns
A QWidget that can be used to configure the plugin. The caller must never delete the returned object, since it is assumed that the PluginConfig object will be able to delete it again safely in its own destructor, invoked as a result of calling destroy().

Implemented in RemoteExecutionSettingsPluginConfig, RenderingSettingsPluginConfig, and EmptyPluginConfig.

◆ isTopLevelConfig()

virtual bool isTopLevelConfig ( ) const
inlinevirtual

Subclasses can implement this function to indicate that this plugin is a top level plugin configuration.

Reimplemented in RemoteExecutionSettingsPluginConfig, RenderingSettingsPluginConfig, and EmptyPluginConfig.

◆ modified

void modified ( )
signal

The subclass should set up signal/slot connections to invoke this signal whenever something in the configuration widget is changed. This allows clients to be notified when the configuration is modified. A typical response will be to enable an "Apply" button in a configuration dialog.

◆ resetConfig()

virtual void resetConfig ( )
pure virtual

Subclasses must implement this function to take whatever action is necessary to revert any changes made to them. This will normally be to reload the plugin's relevant settings into the widget again, as obtained from Settings::getPluginSettings(). It is the caller's responsibility to ensure that Settings::load() has already been called, so subclasses should not need to call it for themselves.

Implemented in RemoteExecutionSettingsPluginConfig, RenderingSettingsPluginConfig, and EmptyPluginConfig.