QSettingsDialog  1.0.0
A Qt library to easily create a settings dialog for user configurable settings
Public Member Functions | List of all members
QSettingsWidget< TWidget > Class Template Reference

Generic base class for settings widgets. More...

#include <qsettingswidget.h>

+ Inheritance diagram for QSettingsWidget< TWidget >:

Public Member Functions

 QSettingsWidget (QWidget *parent=nullptr)
 Creates a new widget with a parent.
 
QWidgetasWidget () final
 Must return this as QWidget (a cast) More...
 
void initialize (const UiPropertyMap &uiPropertyMap) override
 Will be called to initialize the widgets properties with the given ones.
 
- Public Member Functions inherited from QSettingsWidgetBase
 QSettingsWidgetBase ()
 Constructor.
 
virtual ~QSettingsWidgetBase ()
 Virtual Destructor.
 
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

template<class TWidget>
class QSettingsWidget< TWidget >

Generic base class for settings widgets.

Template Parameters
TWidgetA class that is or inherits QWidget. It will be the primary base class of this widget

Use this generic interface to create your own edit widget implementations:

class MyEditWidget : QSettingsWidget<QLineEdit>
{
public:
//...
}

The class can then be registered to the dialog using QSettingsWidgetDialogEngine::addWidgetType.

Member Function Documentation

template<class TWidget>
QWidget* QSettingsWidget< TWidget >::asWidget ( )
inlinefinalvirtual

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.

Implements QSettingsWidgetBase.


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