Class: QgsAttributeEditorContext¶
Contains context information for attribute editor widgets.
It will be passed to embedded widgets whenever this occurs (e.g. when showing an embedded form due to relations)
Methods
Returns |
|
Returns current attributeFormMode |
|
Returns given attributeFormMode as string |
|
Returns the associated CAD dock widget (e.g. to be used in map tools). |
|
Returns the distance area object used for area/length calculations. |
|
Returns current feature from the currently edited form or table row |
|
Returns the form mode. |
|
Returns the main message bar |
|
Returns the associated map canvas (e.g. to zoom to related features). |
|
Returns the feature of the currently edited parent form in its actual state |
|
Returns the attribute relation. |
|
Returns the attribute relation mode. |
|
Sets whether the attribute editor should permit use of custom UI forms. |
|
Set attributeFormMode for the edited form |
|
Sets the associated CAD dock widget, cadDockWidget, (e.g. to be used in map tools). |
|
Sets distance area object, distanceArea, for area/length calculations |
|
Set current feature for the currently edited form or table row |
|
Sets the form mode. |
|
Set current messageBar as the main message bar |
|
Sets the associated map canvas, mapCanvas, (e.g. to zoom to related features). |
|
Sets the feature of the currently edited parent form |
|
Set attribute relation and mode |
|
Sets the associated vector layer tools. |
|
Returns the associated vector layer tools. |
Attributes
- class qgis.gui.QgsAttributeEditorContext[source]¶
Bases:
object
- AddFeatureMode = 1¶
- AggregateSearchMode = 5¶
- Embed = 0¶
- FixAttributeMode = 2¶
- class FormMode¶
Bases:
int
- IdentifyMode = 6¶
- class Mode¶
Bases:
int
- MultiEditMode = 3¶
- Multiple = 1¶
- Popup = 2¶
- class RelationMode¶
Bases:
int
- SearchMode = 4¶
- Single = 2¶
- SingleEditMode = 0¶
- StandaloneDialog = 1¶
- Undefined = 0¶
- allowCustomUi(self) bool [source]¶
Returns
True
if the attribute editor should permit use of custom UI forms.See also
- Return type:
bool
- attributeFormMode(self) QgsAttributeEditorContext.Mode [source]¶
Returns current attributeFormMode
Added in version 3.4.
- Return type:
- attributeFormModeString(self) str [source]¶
Returns given
attributeFormMode
as stringAdded in version 3.4.
- Return type:
str
- cadDockWidget(self) QgsAdvancedDigitizingDockWidget | None [source]¶
Returns the associated CAD dock widget (e.g. to be used in map tools).
Note
Unstable API. This method is unstable API and may be modified or removed at any time.
See also
Added in version 3.10.
- Return type:
Optional[QgsAdvancedDigitizingDockWidget]
- distanceArea(self) QgsDistanceArea ¶
Returns the distance area object used for area/length calculations.
See also
- Return type:
- formFeature(self) QgsFeature [source]¶
Returns current feature from the currently edited form or table row
See also
Added in version 3.2.
- Return type:
- formMode(self) QgsAttributeEditorContext.FormMode [source]¶
Returns the form mode.
See also
- Return type:
- mainMessageBar(self) QgsMessageBar | None [source]¶
Returns the main message bar
Added in version 3.12.
- Return type:
Optional[QgsMessageBar]
- mapCanvas(self) QgsMapCanvas | None [source]¶
Returns the associated map canvas (e.g. to zoom to related features).
See also
Added in version 3.2.
- Return type:
Optional[QgsMapCanvas]
- parentContext(self) QgsAttributeEditorContext | None [source]¶
- Return type:
Optional[QgsAttributeEditorContext]
- parentFormFeature(self) QgsFeature [source]¶
Returns the feature of the currently edited parent form in its actual state
See also
Added in version 3.14.
- Return type:
- relation(self) QgsRelation ¶
Returns the attribute relation.
See also
See also
- Return type:
- relationMode(self) QgsAttributeEditorContext.RelationMode [source]¶
Returns the attribute relation mode.
See also
See also
- Return type:
- setAllowCustomUi(self, allow: bool)[source]¶
Sets whether the attribute editor should permit use of custom UI forms.
- Parameters:
allow (bool) – set to
True
to allow custom UI forms, orFalse
to disable them and use default generated QGIS forms
See also
- setAttributeFormMode(self, attributeFormMode: QgsAttributeEditorContext.Mode)[source]¶
Set
attributeFormMode
for the edited formAdded in version 3.4.
- Parameters:
attributeFormMode (QgsAttributeEditorContext.Mode)
- setCadDockWidget(self, cadDockWidget: QgsAdvancedDigitizingDockWidget | None)[source]¶
Sets the associated CAD dock widget,
cadDockWidget
, (e.g. to be used in map tools).Note
Unstable API. This method is unstable API and may be modified or removed at any time.
See also
Added in version 3.10.
- Parameters:
cadDockWidget (Optional[QgsAdvancedDigitizingDockWidget])
- setDistanceArea(self, distanceArea: QgsDistanceArea)[source]¶
Sets distance area object,
distanceArea
, for area/length calculationsSee also
- Parameters:
distanceArea (QgsDistanceArea)
- setFormFeature(self, feature: QgsFeature)[source]¶
Set current
feature
for the currently edited form or table rowSee also
Added in version 3.2.
- Parameters:
feature (QgsFeature)
- setFormMode(self, mode: QgsAttributeEditorContext.FormMode)[source]¶
Sets the form mode.
- Parameters:
mode (QgsAttributeEditorContext.FormMode) – form mode
See also
- setMainMessageBar(self, messageBar: QgsMessageBar | None)[source]¶
Set current
messageBar
as the main message barAdded in version 3.12.
- Parameters:
messageBar (Optional[QgsMessageBar])
- setMapCanvas(self, mapCanvas: QgsMapCanvas | None)[source]¶
Sets the associated map canvas,
mapCanvas
, (e.g. to zoom to related features).See also
Added in version 3.2.
- Parameters:
mapCanvas (Optional[QgsMapCanvas])
- setParentFormFeature(self, feature: QgsFeature)[source]¶
Sets the
feature
of the currently edited parent formSee also
Added in version 3.14.
- Parameters:
feature (QgsFeature)
- setRelation(self, relation: QgsRelation, mode: QgsAttributeEditorContext.RelationMode)[source]¶
Set attribute relation and mode
- Parameters:
relation (QgsRelation) – relation
mode (QgsAttributeEditorContext.RelationMode) – relation mode
See also
See also
- setVectorLayerTools(self, vlTools: QgsVectorLayerTools | None)[source]¶
Sets the associated vector layer tools.
- Parameters:
vlTools (Optional[QgsVectorLayerTools]) – vector layer tools
See also
- vectorLayerTools(self) QgsVectorLayerTools | None [source]¶
Returns the associated vector layer tools.
See also
- Return type:
Optional[QgsVectorLayerTools]