Class: QgsSettingsEditorWidgetWrapper¶
Base class for settings editor wrappers.
Added in version 3.32.
Note
This is an abstract class, with methods which must be implemented by a subclass.
The following methods must be implemented: configureEditorPrivate()
, createEditorPrivate()
, createWrapper()
, enableAutomaticUpdatePrivate()
, id()
, setSettingFromWidget()
, setWidgetFromSetting()
, setWidgetFromVariant()
, variantValueFromWidget()
Class Hierarchy¶
Base classes¶
Subclasses¶
|
Base factory for editors for settings. |
|
Base factory for editors for settings. |
|
Base factory for editors for settings. |
|
Base factory for editors for settings. |
|
Base factory for editors for settings. |
|
Base factory for editors for settings. |
A settings editor widget wrapper for enum settings as PyQgsSettingsEntryEnumFlag |
Abstract Methods
Configures an existing editor widget |
|
Creates the widgets |
|
Creates a new instance of the editor wrapper so it can be configured for a widget and a setting |
|
Enables automatic update, which causes the setting to be updated immediately when the widget value is changed. |
|
This id of the type of settings it handles |
|
Sets the setting value from the widget value The wrapper must be configured before calling this medthod |
|
Sets the widget value from the setting value The wrapper must be configured before calling this medthod |
|
Sets the value of the widget The wrapper must be configured before calling this medthod |
|
Returns the value from the widget as a variant The wrapper must be configured before calling this medthod |
Methods
Configure the settings update behavior when a widget value is changed. |
|
Configures the editor according the setting |
|
Creates the editor widget for the given setting |
|
Returns the dynamic key parts |
Static Methods
Creates a wrapper from the definition stored in a widget created by |
- 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()
orconfigureEditor()
.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
- abstract configureEditorPrivate(self, editor: QWidget | None, setting: QgsSettingsEntryBase | None) bool [source]¶
Configures an existing
editor
widget- Parameters:
editor (Optional[QWidget])
setting (Optional[QgsSettingsEntryBase])
- 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]
- abstract createEditorPrivate(self, parent: QWidget | None = None) QWidget | None [source]¶
Creates the widgets
- Parameters:
parent (Optional[QWidget] = None)
- Return type:
Optional[QWidget]
- abstract 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]
- abstract 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 bycreateEditor()
- Parameters:
widget (Optional[QWidget])
- Return type:
Optional[QgsSettingsEditorWidgetWrapper]
- abstract 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
- abstract setSettingFromWidget(self) bool [source]¶
Sets the setting value from the widget value The wrapper must be configured before calling this medthod
- Return type:
bool
- abstract setWidgetFromSetting(self) bool [source]¶
Sets the widget value from the setting value The wrapper must be configured before calling this medthod
- Return type:
bool