QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
Base class for settings editor wrappers. More...
#include <qgssettingseditorwidgetwrapper.h>
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 QgsSettingsEditorWidgetWrapper * | createWrapper (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 QgsSettingsEditorWidgetWrapper * | fromWidget (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 |
Base class for settings editor wrappers.
Definition at line 34 of file qgssettingseditorwidgetwrapper.h.
QgsSettingsEditorWidgetWrapper::QgsSettingsEditorWidgetWrapper | ( | QObject * | parent = nullptr | ) |
Constructor.
Definition at line 38 of file qgssettingseditorwidgetwrapper.cpp.
|
virtualdefault |
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.
Definition at line 67 of file qgssettingseditorwidgetwrapper.cpp.
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.
|
protectedpure virtual |
Configures an existing editor widget.
Implemented in QgsSettingsEditorWidgetWrapperTemplate< T, V, U >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryBool, QCheckBox, bool >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryColor, QgsColorButton, QColor >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryDouble, QDoubleSpinBox, double >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryEnumFlag< ENUM >, QComboBox, ENUM >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryEnumFlag< FLAGS >, QComboBox, FLAGS >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryInteger, QSpinBox, int >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryString, QComboBox, QString >, and QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryString, QLineEdit, QString >.
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.
|
protectedpure virtual |
Creates the widgets.
Implemented in QgsSettingsEditorWidgetWrapperTemplate< T, V, U >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryBool, QCheckBox, bool >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryColor, QgsColorButton, QColor >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryDouble, QDoubleSpinBox, double >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryEnumFlag< ENUM >, QComboBox, ENUM >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryEnumFlag< FLAGS >, QComboBox, FLAGS >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryInteger, QSpinBox, int >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryString, QComboBox, QString >, and QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryString, QLineEdit, QString >.
|
pure virtual |
Creates a new instance of the editor wrapper so it can be configured for a widget and a setting.
Implemented in QgsSettingsStringLineEditWrapper, QgsSettingsStringComboBoxWrapper, QgsSettingsBoolCheckBoxWrapper, QgsSettingsIntegerSpinBoxWrapper, QgsSettingsDoubleSpinBoxWrapper, QgsSettingsColorButtonWrapper, QgsSettingsFlagsEditorWidgetWrapper< ENUM, FLAGS >, QgsSettingsEnumEditorWidgetWrapper< ENUM >, QgsSettingsEditorWidgetWrapperTemplate< T, V, U >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryBool, QCheckBox, bool >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryColor, QgsColorButton, QColor >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryDouble, QDoubleSpinBox, double >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryEnumFlag< ENUM >, QComboBox, ENUM >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryEnumFlag< FLAGS >, QComboBox, FLAGS >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryInteger, QSpinBox, int >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryString, QComboBox, QString >, and QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryString, QLineEdit, QString >.
|
inline |
Returns the dynamic key parts.
Definition at line 101 of file qgssettingseditorwidgetwrapper.h.
|
protectedpure virtual |
Enables automatic update, which causes the setting to be updated immediately when the widget value is changed.
Implemented in QgsSettingsStringLineEditWrapper, QgsSettingsStringComboBoxWrapper, QgsSettingsBoolCheckBoxWrapper, QgsSettingsIntegerSpinBoxWrapper, QgsSettingsDoubleSpinBoxWrapper, QgsSettingsColorButtonWrapper, QgsSettingsFlagsEditorWidgetWrapper< ENUM, FLAGS >, and QgsSettingsEnumEditorWidgetWrapper< ENUM >.
|
static |
Creates a wrapper from the definition stored in a widget created by createEditor()
Definition at line 27 of file qgssettingseditorwidgetwrapper.cpp.
|
pure virtual |
This id of the type of settings it handles.
Implemented in QgsSettingsStringLineEditWrapper, QgsSettingsStringComboBoxWrapper, QgsSettingsBoolCheckBoxWrapper, QgsSettingsIntegerSpinBoxWrapper, QgsSettingsDoubleSpinBoxWrapper, QgsSettingsColorButtonWrapper, QgsSettingsFlagsEditorWidgetWrapper< ENUM, FLAGS >, QgsSettingsEnumEditorWidgetWrapper< ENUM >, QgsSettingsEditorWidgetWrapperTemplate< T, V, U >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryBool, QCheckBox, bool >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryColor, QgsColorButton, QColor >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryDouble, QDoubleSpinBox, double >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryEnumFlag< ENUM >, QComboBox, ENUM >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryEnumFlag< FLAGS >, QComboBox, FLAGS >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryInteger, QSpinBox, int >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryString, QComboBox, QString >, and QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryString, QLineEdit, QString >.
|
pure virtual |
Sets the setting value from the widget value The wrapper must be configured before calling this medthod.
Implemented in QgsSettingsStringLineEditWrapper, QgsSettingsStringComboBoxWrapper, QgsSettingsBoolCheckBoxWrapper, QgsSettingsIntegerSpinBoxWrapper, QgsSettingsDoubleSpinBoxWrapper, QgsSettingsColorButtonWrapper, QgsSettingsFlagsEditorWidgetWrapper< ENUM, FLAGS >, QgsSettingsEnumEditorWidgetWrapper< ENUM >, QgsSettingsEditorWidgetWrapperTemplate< T, V, U >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryBool, QCheckBox, bool >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryColor, QgsColorButton, QColor >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryDouble, QDoubleSpinBox, double >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryEnumFlag< ENUM >, QComboBox, ENUM >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryEnumFlag< FLAGS >, QComboBox, FLAGS >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryInteger, QSpinBox, int >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryString, QComboBox, QString >, and QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryString, QLineEdit, QString >.
|
pure virtual |
Sets the widget value from the setting value The wrapper must be configured before calling this medthod.
Implemented in QgsSettingsEditorWidgetWrapperTemplate< T, V, U >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryBool, QCheckBox, bool >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryColor, QgsColorButton, QColor >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryDouble, QDoubleSpinBox, double >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryEnumFlag< ENUM >, QComboBox, ENUM >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryEnumFlag< FLAGS >, QComboBox, FLAGS >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryInteger, QSpinBox, int >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryString, QComboBox, QString >, and QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryString, QLineEdit, QString >.
|
pure virtual |
Sets the value of the widget The wrapper must be configured before calling this medthod.
Implemented in QgsSettingsEditorWidgetWrapperTemplate< T, V, U >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryBool, QCheckBox, bool >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryColor, QgsColorButton, QColor >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryDouble, QDoubleSpinBox, double >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryEnumFlag< ENUM >, QComboBox, ENUM >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryEnumFlag< FLAGS >, QComboBox, FLAGS >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryInteger, QSpinBox, int >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryString, QComboBox, QString >, and QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryString, QLineEdit, QString >.
|
pure virtual |
Returns the value from the widget as a variant The wrapper must be configured before calling this medthod.
Implemented in QgsSettingsEditorWidgetWrapperTemplate< T, V, U >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryBool, QCheckBox, bool >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryColor, QgsColorButton, QColor >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryDouble, QDoubleSpinBox, double >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryEnumFlag< ENUM >, QComboBox, ENUM >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryEnumFlag< FLAGS >, QComboBox, FLAGS >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryInteger, QSpinBox, int >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryString, QComboBox, QString >, QgsSettingsEditorWidgetWrapperTemplate< QgsSettingsEntryString, QLineEdit, QString >, QgsSettingsFlagsEditorWidgetWrapper< ENUM, FLAGS >, and QgsSettingsEnumEditorWidgetWrapper< ENUM >.
|
protected |
Definition at line 118 of file qgssettingseditorwidgetwrapper.h.