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 |
|
- 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:
- editorWidget(self) QgsEditorWidgetWrapper | None[source]¶
Returns the editor widget wrapper
Added in version 3.10.
- Return type:
Optional[QgsEditorWidgetWrapper]
- hasChanged(self) bool[source]¶
Returns
Trueif 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.
- signal rememberLastValueChanged[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- 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
Trueto show in a mixed values state
- setRememberLastValue(self, remember: bool)[source]¶
Sets whether the widget value will be remembered for potential reuse when creating new features
Added in version 4.0.
- Parameters:
remember (bool)
- setVisiblePageForMode()¶
- signal valueChanged[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- signal valuesChanged[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.