Class: QgsAttributeFormEditorWidget¶
A widget consisting of both an editor widget and additional widgets for controlling the behavior of the editor widget depending on a number of possible modes. For instance, if the parent attribute form is in the multi edit mode, this widget will show both the editor widget and a tool button for controlling the multi edit results.
Class Hierarchy¶
Base classes¶
Base class for all widgets shown on a |
|
Methods
Called when field values have been committed; |
|
Returns the current value of the attached editor widget. |
|
Returns the editor widget wrapper |
|
Returns |
|
Resets the widget to an initial value. |
|
Set the constraint result label visible or invisible according to the layer editable status |
|
Set the constraint status for this widget. |
|
Sets whether the widget should be displayed in a "mixed values" mode. |
|
Signals
Emitted when the widget's value changes |
|
Emitted when the widget's value changes |
- class qgis.gui.QgsAttributeFormEditorWidget[source]¶
Bases:
QgsAttributeFormWidget
- __init__(editorWidget: QgsEditorWidgetWrapper | None, widgetType: str | None, form: QgsAttributeForm | None)
Constructor for QgsAttributeFormEditorWidget.
- Parameters:
editorWidget (Optional[QgsEditorWidgetWrapper]) – associated editor widget wrapper (for default/edit modes)
widgetType (Optional[str]) – the type identifier of the widget passed in the wrapper
form (Optional[QgsAttributeForm]) – parent attribute form
- currentValue(self) Any [source]¶
Returns the current value of the attached editor widget.
- Return type:
Any
- editorWidget(self) QgsEditorWidgetWrapper | None [source]¶
Returns the editor widget wrapper
Added in version 3.10.
- Return type:
Optional[QgsEditorWidgetWrapper]
- hasChanged(self) bool [source]¶
Returns
True
if the widget’s value has been changed since it was initialized.See also
- Return type:
bool
- initialize(self, initialValue: Any, mixedValues: bool = False, additionalFieldValues: Iterable[Any] = [])[source]¶
Resets the widget to an initial value.
- Parameters:
initialValue (Any) – initial value to show in widget
mixedValues (bool = False) – set to
True
to initially show the mixed values stateadditionalFieldValues (Iterable[Any] = []) – a variant map of additional field names with their corresponding values
- setConstraintResultVisible(self, editable: bool)[source]¶
Set the constraint result label visible or invisible according to the layer editable status
- Parameters:
editable (bool)
- setConstraintStatus(self, constraint: str | None, description: str | None, err: str | None, result: QgsEditorWidgetWrapper.ConstraintResult)[source]¶
Set the constraint status for this widget.
- Parameters:
constraint (Optional[str])
description (Optional[str])
err (Optional[str])
- setIsMixed(self, mixed: bool)[source]¶
Sets whether the widget should be displayed in a “mixed values” mode.
- Parameters:
mixed (bool) – set to
True
to show in a mixed values state
- setVisiblePageForMode()¶