QSettingsDialog  1.0.0
A Qt library to easily create a settings dialog for user configurable settings
Public Member Functions | List of all members
QSettingsWidgetBase Class Referenceabstract

The base class for edit widgets in the settings dialog. More...

#include <qsettingswidget.h>

+ Inheritance diagram for QSettingsWidgetBase:

Public Member Functions

 QSettingsWidgetBase ()
 Constructor.
 
virtual ~QSettingsWidgetBase ()
 Virtual Destructor.
 
virtual QWidgetasWidget ()=0
 Must return this as QWidget (a cast) More...
 
virtual void initialize (const UiPropertyMap &uiPropertyMap)=0
 Will be called to initialize the widgets properties with the given ones.
 
virtual bool hasValueChanged () const
 Will be called to determine, whether the value has changed or not. More...
 
virtual void resetValueChanged ()
 Resets the value changed status to unchanged. More...
 
virtual void setValue (const QVariant &value)=0
 Sets the edit widgets "value".
 
virtual QVariant getValue () const =0
 Gets the edit widgets "value".
 
virtual void resetValue ()=0
 Resets the edit widgets "value".
 
virtual bool searchExpression (const QRegularExpression &regex)
 Will be called to search for a specific expression inside the edit widget. More...
 

Detailed Description

The base class for edit widgets in the settings dialog.

Implementations must inherit from QWidget!

Note
You should not use this class directly. It simply serves as base for the generic interface. You should only implement the QSettingsWidget interface!

Member Function Documentation

QSettingsWidgetBase::asWidget ( )
pure virtual

Must return this as QWidget (a cast)

Returns
(QWidget*)this;
Warning
This function MUST return itself. It's basically a shortcut for (QWidget*)element, and is there to ensure all widgets that implement this interface do inherit QWidget.

Implemented in QSettingsWidget< TWidget >, and QSettingsWidget< QWidget >.

QSettingsWidgetBase::hasValueChanged ( ) const
virtual

Will be called to determine, whether the value has changed or not.

Returns
true, if the value has changed since the last reset, false if not

This function will determine whether the data within this edit will be saved or not. Only if it returs true, data will actually be saved. The "changed" is relative to the status from the last QSettingsWidgetBase::resetValueChanged. This means, immediatly after a call to that function, this one should always return false. And only if the current state of the edit is different from the one it had when that funcion was called, true shall be returned

Note
For most edit widgets, the default implementation is sufficient.

Reimplemented in QSettingsDialogWidget< TSettingsWidget >.

QSettingsWidgetBase::resetValueChanged ( )
virtual

Resets the value changed status to unchanged.

See QSettingsWidgetBase::hasValueChanged.

Note
For most edit widgets, the default implementation is sufficient.

Reimplemented in QSettingsDialogWidget< TSettingsWidget >.

QSettingsWidgetBase::searchExpression ( const QRegularExpression regex)
inlinevirtual

Will be called to search for a specific expression inside the edit widget.

Parameters
regexThe regular expression to match against
Returns
true, if this edit matches the expression, false if not

Reimplement this function if your edit should be used to help find search entries. The default implementation matches on nothing

Note
If the regex is empty, this function must always return true.

Reimplemented in QSettingsDialogWidget< TSettingsWidget >.


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