QGIS API Documentation 3.41.0-Master (3c143d501a8)
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsSettingsEditorWidgetWrapperTemplate< T, V, U > Class Template Referenceabstract

This class is a base factory of editor for settings. More...

#include <qgssettingseditorwidgetwrapperimpl.h>

Inheritance diagram for QgsSettingsEditorWidgetWrapperTemplate< T, V, U >:
Inheritance graph
[legend]

Public Member Functions

 QgsSettingsEditorWidgetWrapperTemplate (QObject *parent=nullptr)
 Constructor.
 
virtual 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.
 
virtual QString id () const override=0
 This id of the type of settings it handles.
 
virtual 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.
 
virtual 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.
 
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.
 
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)
 
virtual 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 >

This class is a base factory of editor for settings.

Since
QGIS 3.32

Definition at line 46 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 50 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 98 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, QgsSettingsFlagsEditorWidgetWrapper< ENUM, FLAGS >, and QgsSettingsEnumEditorWidgetWrapper< ENUM >.

Definition at line 112 of file qgssettingseditorwidgetwrapperimpl.h.

◆ createEditorPrivate()

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

Creates the widgets.

Implements QgsSettingsEditorWidgetWrapper.

Definition at line 91 of file qgssettingseditorwidgetwrapperimpl.h.

◆ createWrapper()

template<class T , class V , class U >
virtual 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 83 of file qgssettingseditorwidgetwrapperimpl.h.

◆ id()

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

◆ setSettingFromWidget()

template<class T , class V , class U >
virtual 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 86 of file qgssettingseditorwidgetwrapperimpl.h.

◆ setWidgetFromSetting()

template<class T , class V , class U >
virtual 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 55 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 66 of file qgssettingseditorwidgetwrapperimpl.h.

◆ setWidgetValue()

template<class T , class V , class U >
virtual bool QgsSettingsEditorWidgetWrapperTemplate< T, V, U >::setWidgetValue ( const U &  value) const
pure virtual

◆ valueFromWidget()

template<class T , class V , class U >
virtual U QgsSettingsEditorWidgetWrapperTemplate< T, V, U >::valueFromWidget ( ) const
pure virtual

◆ 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 QgsSettingsFlagsEditorWidgetWrapper< ENUM, FLAGS >, and QgsSettingsEnumEditorWidgetWrapper< ENUM >.

Definition at line 74 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 115 of file qgssettingseditorwidgetwrapperimpl.h.

◆ mSetting

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

Definition at line 114 of file qgssettingseditorwidgetwrapperimpl.h.


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