Class: QgsSettingsEditorWidgetWrapper

Base class for settings editor wrappers

Added in version 3.32.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsSettingsEditorWidgetWrapper

Base classes

QObject

Subclasses

QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryBoolQCheckBoxboolBase

This class is a base factory of editor for settings

QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryColorQgsColorButtonQColorBase

This class is a base factory of editor for settings

QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryDoubleQDoubleSpinBoxdoubleBase

This class is a base factory of editor for settings

QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryIntegerQSpinBoxintBase

This class is a base factory of editor for settings

QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryStringQComboBoxQStringBase

This class is a base factory of editor for settings

QgsSettingsEditorWidgetWrapperTemplateQgsSettingsEntryStringQLineEditQStringBase

This class is a base factory of editor for settings

PyQgsSettingsEnumEditorWidgetWrapper

A settings editor widget wrapper for enum settings as PyQgsSettingsEntryEnumFlag

Methods

configureAutomaticUpdate

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

configureEditor

Configures the editor according the setting

configureEditorPrivate

Configures an existing editor widget

createEditor

Creates the editor widget for the given setting

createEditorPrivate

Creates the widgets

createWrapper

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

dynamicKeyPartList

Returns the dynamic key parts

enableAutomaticUpdatePrivate

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

id

This id of the type of settings it handles

setSettingFromWidget

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

setWidgetFromSetting

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

setWidgetFromVariant

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

variantValueFromWidget

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

Static Methods

fromWidget

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

class qgis.gui.QgsSettingsEditorWidgetWrapper[source]

Bases: QObject

__init__(parent: QObject | None = None)

Constructor

Parameters:

parent (Optional[QObject] = None)

configureAutomaticUpdate(self, dialog: QDialog | None = None)[source]

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().

Added in version 3.40.

Parameters:

dialog (Optional[QDialog] = None)

configureEditor(self, editor: QWidget | None, setting: QgsSettingsEntryBase | None, dynamicKeyPartList: Iterable[str | None] = []) bool[source]

Configures the editor according the setting

Parameters:
  • editor (Optional[QWidget])

  • setting (Optional[QgsSettingsEntryBase])

  • dynamicKeyPartList (Iterable[Optional[str]] = [])

Return type:

bool

configureEditorPrivate(self, editor: QWidget | None, setting: QgsSettingsEntryBase | None) bool[source]

Configures an existing editor widget

Parameters:
Return type:

bool

createEditor(self, setting: QgsSettingsEntryBase | None, dynamicKeyPartList: Iterable[str | None] = [], parent: QWidget | None = None) QWidget | None[source]

Creates the editor widget for the given setting

Parameters:
  • setting (Optional[QgsSettingsEntryBase])

  • dynamicKeyPartList (Iterable[Optional[str]] = [])

  • parent (Optional[QWidget] = None)

Return type:

Optional[QWidget]

createEditorPrivate(self, parent: QWidget | None = None) QWidget | None[source]

Creates the widgets

Parameters:

parent (Optional[QWidget] = None)

Return type:

Optional[QWidget]

createWrapper(self, parent: QObject | None = None) QgsSettingsEditorWidgetWrapper | None[source]

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

Parameters:

parent (Optional[QObject] = None)

Return type:

Optional[QgsSettingsEditorWidgetWrapper]

dynamicKeyPartList(self) List[str][source]

Returns the dynamic key parts

Added in version 3.40.

Return type:

List[str]

enableAutomaticUpdatePrivate(self)[source]

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

Added in version 3.40.

static fromWidget(widget: QWidget | None) QgsSettingsEditorWidgetWrapper | None[source]

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

Parameters:

widget (Optional[QWidget])

Return type:

Optional[QgsSettingsEditorWidgetWrapper]

id(self) str[source]

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.

Return type:

str

setSettingFromWidget(self) bool[source]

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

Return type:

bool

setWidgetFromSetting(self) bool[source]

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

Return type:

bool

setWidgetFromVariant(self, value: Any) bool[source]

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

Parameters:

value (Any)

Return type:

bool

variantValueFromWidget(self) Any[source]

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

Return type:

Any