QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
QgsSettingsEditorWidgetWrapperTemplate< T, V, U > Class Template Referenceabstract

Base factory for editors for settings. More...

#include <qgssettingseditorwidgetwrapperimpl.h>

Inheritance diagram for QgsSettingsEditorWidgetWrapperTemplate< T, V, U >:

Public Member Functions

 QgsSettingsEditorWidgetWrapperTemplate (QObject *parent=nullptr)
 Constructor.
QgsSettingsEditorWidgetWrappercreateWrapper (QObject *parent=nullptr) const override=0
 Creates a new instance of the editor wrapper so it can be configured for a widget and a setting.
V * editor () const
 Returns the editor.
QString id () const override=0
 This id of the type of settings it handles.
bool setSettingFromWidget () const override=0
 Sets the setting value from the widget value The wrapper must be configured before calling this medthod.
const T * setting () const
 Returns the setting.
bool setWidgetFromSetting () const override
 Sets the widget value from the setting value The wrapper must be configured before calling this medthod.
bool setWidgetFromVariant (const QVariant &value) const override
 Sets the value of the widget The wrapper must be configured before calling this medthod.
virtual bool setWidgetValue (const U &value) const =0
 Sets the widget value.
virtual U valueFromWidget () const =0
 Returns the widget value.
QVariant variantValueFromWidget () const override
 Returns the value from the widget as a variant The wrapper must be configured before calling this medthod.
Public Member Functions inherited from QgsSettingsEditorWidgetWrapper
 QgsSettingsEditorWidgetWrapper (QObject *parent=nullptr)
 Constructor.
 ~QgsSettingsEditorWidgetWrapper () override=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.
QStringList dynamicKeyPartList () const
 Returns the dynamic key parts.

Protected Member Functions

bool configureEditorPrivate (QWidget *editor, const QgsSettingsEntryBase *setting) override
 Configures an existing editor widget.
virtual void configureEditorPrivateImplementation ()
 To be re-implemented to implemeent type specific configuration (e.g. opacity for colors).
QWidget * createEditorPrivate (QWidget *parent=nullptr) const override
 Creates the widgets.
Protected Member Functions inherited from QgsSettingsEditorWidgetWrapper
virtual void enableAutomaticUpdatePrivate ()=0
 Enables automatic update, which causes the setting to be updated immediately when the widget value is changed.

Protected Attributes

V * mEditor = nullptr
const T * mSetting = nullptr
Protected Attributes inherited from QgsSettingsEditorWidgetWrapper
QStringList mDynamicKeyPartList

Additional Inherited Members

Static Public Member Functions inherited from QgsSettingsEditorWidgetWrapper
static QgsSettingsEditorWidgetWrapperfromWidget (const QWidget *widget)
 Creates a wrapper from the definition stored in a widget created by createEditor().

Detailed Description

template<class T, class V, class U>
class QgsSettingsEditorWidgetWrapperTemplate< T, V, U >

Base factory for editors for settings.

Since
QGIS 3.32

Definition at line 44 of file qgssettingseditorwidgetwrapperimpl.h.

Constructor & Destructor Documentation

◆ QgsSettingsEditorWidgetWrapperTemplate()

template<class T, class V, class U>
QgsSettingsEditorWidgetWrapperTemplate< T, V, U >::QgsSettingsEditorWidgetWrapperTemplate ( QObject * parent = nullptr)
inline

Constructor.

Definition at line 48 of file qgssettingseditorwidgetwrapperimpl.h.

Member Function Documentation

◆ configureEditorPrivate()

template<class T, class V, class U>
bool QgsSettingsEditorWidgetWrapperTemplate< T, V, U >::configureEditorPrivate ( QWidget * editor,
const QgsSettingsEntryBase * setting )
inlineoverrideprotectedvirtual

Configures an existing editor widget.

Implements QgsSettingsEditorWidgetWrapper.

Definition at line 96 of file qgssettingseditorwidgetwrapperimpl.h.

◆ configureEditorPrivateImplementation()

template<class T, class V, class U>
virtual void QgsSettingsEditorWidgetWrapperTemplate< T, V, U >::configureEditorPrivateImplementation ( )
inlineprotectedvirtual

To be re-implemented to implemeent type specific configuration (e.g. opacity for colors).

Reimplemented in QgsSettingsColorButtonWrapper, QgsSettingsEnumEditorWidgetWrapper< ENUM >, and QgsSettingsFlagsEditorWidgetWrapper< ENUM, FLAGS >.

Definition at line 110 of file qgssettingseditorwidgetwrapperimpl.h.

◆ createEditorPrivate()

template<class T, class V, class U>
QWidget * QgsSettingsEditorWidgetWrapperTemplate< T, V, U >::createEditorPrivate ( QWidget * parent = nullptr) const
inlineoverrideprotectedvirtual

Creates the widgets.

Implements QgsSettingsEditorWidgetWrapper.

Definition at line 89 of file qgssettingseditorwidgetwrapperimpl.h.

◆ createWrapper()

template<class T, class V, class U>
QgsSettingsEditorWidgetWrapper * QgsSettingsEditorWidgetWrapperTemplate< T, V, U >::createWrapper ( QObject * parent = nullptr) const
overridepure virtual

◆ editor()

template<class T, class V, class U>
V * QgsSettingsEditorWidgetWrapperTemplate< T, V, U >::editor ( ) const
inline

Returns the editor.

Definition at line 81 of file qgssettingseditorwidgetwrapperimpl.h.

◆ id()

template<class T, class V, class U>
QString QgsSettingsEditorWidgetWrapperTemplate< T, V, U >::id ( ) const
overridepure virtual

◆ setSettingFromWidget()

template<class T, class V, class U>
bool QgsSettingsEditorWidgetWrapperTemplate< T, V, U >::setSettingFromWidget ( ) const
overridepure virtual

◆ setting()

template<class T, class V, class U>
const T * QgsSettingsEditorWidgetWrapperTemplate< T, V, U >::setting ( ) const
inline

Returns the setting.

Definition at line 84 of file qgssettingseditorwidgetwrapperimpl.h.

◆ setWidgetFromSetting()

template<class T, class V, class U>
bool QgsSettingsEditorWidgetWrapperTemplate< T, V, U >::setWidgetFromSetting ( ) const
inlineoverridevirtual

Sets the widget value from the setting value The wrapper must be configured before calling this medthod.

Implements QgsSettingsEditorWidgetWrapper.

Definition at line 53 of file qgssettingseditorwidgetwrapperimpl.h.

◆ setWidgetFromVariant()

template<class T, class V, class U>
bool QgsSettingsEditorWidgetWrapperTemplate< T, V, U >::setWidgetFromVariant ( const QVariant & value) const
inlineoverridevirtual

Sets the value of the widget The wrapper must be configured before calling this medthod.

Implements QgsSettingsEditorWidgetWrapper.

Definition at line 64 of file qgssettingseditorwidgetwrapperimpl.h.

◆ setWidgetValue()

◆ valueFromWidget()

◆ variantValueFromWidget()

template<class T, class V, class U>
QVariant QgsSettingsEditorWidgetWrapperTemplate< T, V, U >::variantValueFromWidget ( ) const
inlineoverridevirtual

Returns the value from the widget as a variant The wrapper must be configured before calling this medthod.

Implements QgsSettingsEditorWidgetWrapper.

Reimplemented in QgsSettingsEnumEditorWidgetWrapper< ENUM >, and QgsSettingsFlagsEditorWidgetWrapper< ENUM, FLAGS >.

Definition at line 72 of file qgssettingseditorwidgetwrapperimpl.h.

Member Data Documentation

◆ mEditor

template<class T, class V, class U>
V* QgsSettingsEditorWidgetWrapperTemplate< T, V, U >::mEditor = nullptr
protected

Definition at line 113 of file qgssettingseditorwidgetwrapperimpl.h.

◆ mSetting

template<class T, class V, class U>
const T* QgsSettingsEditorWidgetWrapperTemplate< T, V, U >::mSetting = nullptr
protected

Definition at line 112 of file qgssettingseditorwidgetwrapperimpl.h.


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