QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
QgsSettingsStringComboBoxWrapper Class Reference

This class is a factory of editor for string settings with a combo box. More...

#include <qgssettingseditorwidgetwrapperimpl.h>

Inheritance diagram for QgsSettingsStringComboBoxWrapper:
Inheritance graph
[legend]

Public Types

enum class  Mode : int { Text , Data }
 Mode to determine if the value is hold in the combo box text or data. More...
 

Public Member Functions

 QgsSettingsStringComboBoxWrapper (QObject *parent=nullptr)
 Constructor of the factory.
 
 QgsSettingsStringComboBoxWrapper (QWidget *editor, const QgsSettingsEntryBase *setting, const QStringList &dynamicKeyPartList=QStringList())
 Constructor of the wrapper for a given setting and its widget editor.
 
 QgsSettingsStringComboBoxWrapper (QWidget *editor, const QgsSettingsEntryBase *setting, Mode mode, const QStringList &dynamicKeyPartList=QStringList())
 Constructor of the wrapper for a given setting and its widget editor.
 
QgsSettingsEditorWidgetWrappercreateWrapper (QObject *parent=nullptr) const override
 Creates a new instance of the editor wrapper so it can be configured for a widget and a setting.
 
void enableAutomaticUpdatePrivate () override
 Enables automatic update, which causes the setting to be updated immediately when the widget value is changed.
 
QString id () const override
 This id of the type of settings it handles.
 
bool setSettingFromWidget () const override
 Sets the setting value from the widget value The wrapper must be configured before calling this medthod.
 
bool setWidgetValue (const QString &value) const override
 Sets the widget value.
 
QString valueFromWidget () const override
 Returns the widget value.
 
- Public Member Functions inherited from QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryString, QComboBox, QString >
 QgsSettingsEditorWidgetWrapperTemplate (QObject *parent=nullptr)
 Constructor.
 
QComboBox * editor () const
 Returns the editor.
 
const QgsSettingsEntryStringsetting () 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.
 
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.
 

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()
 
- Protected Member Functions inherited from QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryString, QComboBox, QString >
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 Attributes inherited from QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryString, QComboBox, QString >
QComboBox * mEditor
 
const QgsSettingsEntryStringmSetting
 
- Protected Attributes inherited from QgsSettingsEditorWidgetWrapper
QStringList mDynamicKeyPartList
 

Detailed Description

This class is a factory of editor for string settings with a combo box.

Since
QGIS 3.40

Definition at line 158 of file qgssettingseditorwidgetwrapperimpl.h.

Member Enumeration Documentation

◆ Mode

enum class QgsSettingsStringComboBoxWrapper::Mode : int
strong

Mode to determine if the value is hold in the combo box text or data.

Enumerator
Text 

Value is defined as the text entry.

Data 

Value is defined as data entry with Qt::UserRole.

Definition at line 163 of file qgssettingseditorwidgetwrapperimpl.h.

Constructor & Destructor Documentation

◆ QgsSettingsStringComboBoxWrapper() [1/3]

QgsSettingsStringComboBoxWrapper::QgsSettingsStringComboBoxWrapper ( QObject *  parent = nullptr)
inline

Constructor of the factory.

Definition at line 170 of file qgssettingseditorwidgetwrapperimpl.h.

◆ QgsSettingsStringComboBoxWrapper() [2/3]

QgsSettingsStringComboBoxWrapper::QgsSettingsStringComboBoxWrapper ( QWidget *  editor,
const QgsSettingsEntryBase setting,
const QStringList &  dynamicKeyPartList = QStringList() 
)
inline

Constructor of the wrapper for a given setting and its widget editor.

Definition at line 174 of file qgssettingseditorwidgetwrapperimpl.h.

◆ QgsSettingsStringComboBoxWrapper() [3/3]

QgsSettingsStringComboBoxWrapper::QgsSettingsStringComboBoxWrapper ( QWidget *  editor,
const QgsSettingsEntryBase setting,
Mode  mode,
const QStringList &  dynamicKeyPartList = QStringList() 
)
inline

Constructor of the wrapper for a given setting and its widget editor.

Definition at line 178 of file qgssettingseditorwidgetwrapperimpl.h.

Member Function Documentation

◆ createWrapper()

QgsSettingsEditorWidgetWrapper * QgsSettingsStringComboBoxWrapper::createWrapper ( QObject *  parent = nullptr) const
inlineoverridevirtual

Creates a new instance of the editor wrapper so it can be configured for a widget and a setting.

Implements QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryString, QComboBox, QString >.

Definition at line 181 of file qgssettingseditorwidgetwrapperimpl.h.

◆ enableAutomaticUpdatePrivate()

void QgsSettingsStringComboBoxWrapper::enableAutomaticUpdatePrivate ( )
overridevirtual

Enables automatic update, which causes the setting to be updated immediately when the widget value is changed.

Since
QGIS 3.40

Implements QgsSettingsEditorWidgetWrapper.

Definition at line 116 of file qgssettingseditorwidgetwrapperimpl.cpp.

◆ id()

QString QgsSettingsStringComboBoxWrapper::id ( ) const
overridevirtual

This id of the type of settings it handles.

Note
This mostly correspond to the content of Qgis::SettingsType but it's a string since custom Python implementation are possible.

Implements QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryString, QComboBox, QString >.

Definition at line 89 of file qgssettingseditorwidgetwrapperimpl.cpp.

◆ setSettingFromWidget()

bool QgsSettingsStringComboBoxWrapper::setSettingFromWidget ( ) const
overridevirtual

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

Implements QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryString, QComboBox, QString >.

Definition at line 127 of file qgssettingseditorwidgetwrapperimpl.cpp.

◆ setWidgetValue()

bool QgsSettingsStringComboBoxWrapper::setWidgetValue ( const QString &  value) const
overridevirtual

◆ valueFromWidget()

QString QgsSettingsStringComboBoxWrapper::valueFromWidget ( ) const
overridevirtual

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