ConfigurationWidget Class Referenceabstract

The base class for widgets for editing configuration parameters. More...

Inheritance diagram for ConfigurationWidget:

Signals

void parametersChanged ()
 The signal emitted when parameters are changed.
 

Public Member Functions

 ConfigurationWidget (ConfigurationParameters &params, QString prefix, QWidget *parent=NULL, Qt::WindowFlags f=0)
 Constructor.
 
virtual ~ConfigurationWidget ()
 Destructor.
 
virtual bool configuringSubgroups () const =0
 Returns whether this will take care of editing the parameters of subgroups or not.
 

Protected Attributes

ConfigurationParametersm_params
 The ConfigurationParameters instance with the parameters we have to edit.
 
const QString m_prefix
 The group with parameters to edit.
 

Detailed Description

The base class for widgets for editing configuration parameters.

This is the base class for all widgets that are used to change parameters of groups. If a parameterSettable child class needs a particular widget to be configured (because it would be difficult o manually set parameter values, think of e.g. neural networks) it can declare which class to use to edit its parameters in its describe() method. The Factory class can then be used to obtain an instance of the editor. If no editor is registered, a default one is used (which basically allows editing of parameters using LineEdits). The ConfigurationParameters object on which an instance of this will work (i.e. the one which it will edit) is passed as a reference to the constructor along with the prefix. Both are saved and accessible to subclasses. Once set the ConfigurationParameters and prefix cannot be changed: you need to destroy and recreate a new editor if you need to act on a new set of parameters. This class has only one pure virtual function, namely configuringSubgroups(). It returns a boolean value depending on whether this class will take care of all the subgroups of the group given by prefix or not.

Definition at line 51 of file configurationwidget.h.

Constructor & Destructor Documentation

ConfigurationWidget ( ConfigurationParameters params,
QString  prefix,
QWidget *  parent = NULL,
Qt::WindowFlags  f = 0 
)
inline

Constructor.

Parameters
paramsthe ConfigurationParameters instance with the parameters we have to edit
prefixthe group whose parameters we edit
parentthe parent widget
fthe window flags for this widget

Definition at line 64 of file configurationwidget.h.

virtual ~ConfigurationWidget ( )
inlinevirtual

Destructor.

Definition at line 74 of file configurationwidget.h.

Member Function Documentation

virtual bool configuringSubgroups ( ) const
pure virtual

Returns whether this will take care of editing the parameters of subgroups or not.

Reimplement in subclasses to return true or false depending on whether this widget will take care of editing the parameters of the subgroups of the given group or not

Returns
true if this editor will edit the parameters of subgroups, false otherwise
void parametersChanged ( )
signal

The signal emitted when parameters are changed.

This signal should be emitted by subclasses whenever some parameter changes. This does not give any information on which parameter has changed, it is only meant to signal the receiver that the ConfigurationParameters has been modified. This way it can, for example, allow the user to save the new parameters

Member Data Documentation

ConfigurationParameters& m_params
protected

The ConfigurationParameters instance with the parameters we have to edit.

Definition at line 107 of file configurationwidget.h.

const QString m_prefix
protected

The group with parameters to edit.

Definition at line 112 of file configurationwidget.h.


The documentation for this class was generated from the following file: