QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsSettingsEditorWidgetWrapper Class Referenceabstract

Base class for settings editor wrappers. More...

#include <qgssettingseditorwidgetwrapper.h>

Inheritance diagram for QgsSettingsEditorWidgetWrapper:
Inheritance graph
[legend]

Public Member Functions

 QgsSettingsEditorWidgetWrapper (QObject *parent=nullptr)
 Constructor.
 
virtual ~QgsSettingsEditorWidgetWrapper ()=default
 
void configureAutomaticUpdate (QDialog *dialog=nullptr)
 Configure the settings update behavior when a widget value is changed.
 
bool configureEditor (QWidget *editor, const QgsSettingsEntryBase *setting, const QStringList &dynamicKeyPartList=QStringList())
 Configures the editor according the setting.
 
QWidget * createEditor (const QgsSettingsEntryBase *setting, const QStringList &dynamicKeyPartList=QStringList(), QWidget *parent=nullptr)
 Creates the editor widget for the given setting.
 
virtual QgsSettingsEditorWidgetWrappercreateWrapper (QObject *parent=nullptr) const =0
 Creates a new instance of the editor wrapper so it can be configured for a widget and a setting.
 
QStringList dynamicKeyPartList () const
 Returns the dynamic key parts.
 
virtual QString id () const =0
 This id of the type of settings it handles.
 
virtual bool setSettingFromWidget () const =0
 Sets the setting value from the widget value The wrapper must be configured before calling this medthod.
 
virtual bool setWidgetFromSetting () const =0
 Sets the widget value from the setting value The wrapper must be configured before calling this medthod.
 
virtual bool setWidgetFromVariant (const QVariant &value) const =0
 Sets the value of the widget The wrapper must be configured before calling this medthod.
 
virtual QVariant variantValueFromWidget () const =0
 Returns the value from the widget as a variant The wrapper must be configured before calling this medthod.
 

Static Public Member Functions

static QgsSettingsEditorWidgetWrapperfromWidget (const QWidget *widget)
 Creates a wrapper from the definition stored in a widget created by createEditor()
 

Protected Member Functions

virtual bool configureEditorPrivate (QWidget *editor, const QgsSettingsEntryBase *setting)=0
 Configures an existing editor widget.
 
virtual QWidget * createEditorPrivate (QWidget *parent=nullptr) const =0
 Creates the widgets.
 
virtual void enableAutomaticUpdatePrivate ()=0
 Enables automatic update, which causes the setting to be updated immediately when the widget value is changed.
 

Protected Attributes

QStringList mDynamicKeyPartList
 

Detailed Description

Base class for settings editor wrappers.

Since
QGIS 3.32

Definition at line 34 of file qgssettingseditorwidgetwrapper.h.

Constructor & Destructor Documentation

◆ QgsSettingsEditorWidgetWrapper()

QgsSettingsEditorWidgetWrapper::QgsSettingsEditorWidgetWrapper ( QObject *  parent = nullptr)

Constructor.

Definition at line 38 of file qgssettingseditorwidgetwrapper.cpp.

◆ ~QgsSettingsEditorWidgetWrapper()

virtual QgsSettingsEditorWidgetWrapper::~QgsSettingsEditorWidgetWrapper ( )
virtualdefault

Member Function Documentation

◆ configureAutomaticUpdate()

void QgsSettingsEditorWidgetWrapper::configureAutomaticUpdate ( QDialog *  dialog = nullptr)

Configure the settings update behavior when a widget value is changed.

If a dialog is provided, the setting will be updated when the dialog is accepted. If not, the setting will be updated directly at each widget value change.

Note
This must called after createEditor() or configureEditor().
Since
QGIS 3.40

Definition at line 67 of file qgssettingseditorwidgetwrapper.cpp.

◆ configureEditor()

bool QgsSettingsEditorWidgetWrapper::configureEditor ( QWidget *  editor,
const QgsSettingsEntryBase setting,
const QStringList &  dynamicKeyPartList = QStringList() 
)

Configures the editor according the setting.

Definition at line 53 of file qgssettingseditorwidgetwrapper.cpp.

◆ configureEditorPrivate()

virtual bool QgsSettingsEditorWidgetWrapper::configureEditorPrivate ( QWidget *  editor,
const QgsSettingsEntryBase setting 
)
protectedpure virtual

◆ createEditor()

QWidget * QgsSettingsEditorWidgetWrapper::createEditor ( const QgsSettingsEntryBase setting,
const QStringList &  dynamicKeyPartList = QStringList(),
QWidget *  parent = nullptr 
)

Creates the editor widget for the given setting.

Definition at line 43 of file qgssettingseditorwidgetwrapper.cpp.

◆ createEditorPrivate()

virtual QWidget * QgsSettingsEditorWidgetWrapper::createEditorPrivate ( QWidget *  parent = nullptr) const
protectedpure virtual

◆ createWrapper()

virtual QgsSettingsEditorWidgetWrapper * QgsSettingsEditorWidgetWrapper::createWrapper ( QObject *  parent = nullptr) const
pure virtual

◆ dynamicKeyPartList()

QStringList QgsSettingsEditorWidgetWrapper::dynamicKeyPartList ( ) const
inline

Returns the dynamic key parts.

Since
QGIS 3.40

Definition at line 101 of file qgssettingseditorwidgetwrapper.h.

◆ enableAutomaticUpdatePrivate()

virtual void QgsSettingsEditorWidgetWrapper::enableAutomaticUpdatePrivate ( )
protectedpure virtual

◆ fromWidget()

QgsSettingsEditorWidgetWrapper * QgsSettingsEditorWidgetWrapper::fromWidget ( const QWidget *  widget)
static

Creates a wrapper from the definition stored in a widget created by createEditor()

Definition at line 27 of file qgssettingseditorwidgetwrapper.cpp.

◆ id()

virtual QString QgsSettingsEditorWidgetWrapper::id ( ) const
pure virtual

◆ setSettingFromWidget()

virtual bool QgsSettingsEditorWidgetWrapper::setSettingFromWidget ( ) const
pure virtual

◆ setWidgetFromSetting()

virtual bool QgsSettingsEditorWidgetWrapper::setWidgetFromSetting ( ) const
pure virtual

◆ setWidgetFromVariant()

virtual bool QgsSettingsEditorWidgetWrapper::setWidgetFromVariant ( const QVariant &  value) const
pure virtual

◆ variantValueFromWidget()

virtual QVariant QgsSettingsEditorWidgetWrapper::variantValueFromWidget ( ) const
pure virtual

Member Data Documentation

◆ mDynamicKeyPartList

QStringList QgsSettingsEditorWidgetWrapper::mDynamicKeyPartList
protected

Definition at line 118 of file qgssettingseditorwidgetwrapper.h.


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