Class: QgsAttributeEditorContext¶
- class qgis.gui.QgsAttributeEditorContext¶
Bases:
sip.wrapper
This class 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)
QgsAttributeEditorContext() Constructor for QgsAttributeEditorContext
QgsAttributeEditorContext(parentContext:
QgsAttributeEditorContext
, formMode: QgsAttributeEditorContext.FormMode)QgsAttributeEditorContext(parentContext:
QgsAttributeEditorContext
, relation:QgsRelation
, relationMode: QgsAttributeEditorContext.RelationMode, widgetMode: QgsAttributeEditorContext.FormMode)QgsAttributeEditorContext(
QgsAttributeEditorContext
)Methods
Returns
True
if the attribute editor should permit use of custom UI forms.Returns current attributeFormMode
Returns given
attributeFormMode
as stringReturns the associated CAD dock widget (e.g.
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.
- rtype
QgsAttributeEditorContext
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 formSets the associated CAD dock widget,
cadDockWidget
, (e.g.Sets distance area object,
distanceArea
, for area/length calculationsSet current
feature
for the currently edited form or table rowSets the form mode.
Set current
messageBar
as the main message barSets the associated map canvas,
mapCanvas
, (e.g.Sets the
feature
of the currently edited parent formSet attribute relation and mode
Sets the associated vector layer tools.
Returns the associated vector layer tools.
Attributes
- AddFeatureMode = 1¶
- AggregateSearchMode = 5¶
- Embed = 0¶
- FixAttributeMode = 2¶
- class FormMode¶
Bases:
int
- IdentifyMode = 6¶
- class Mode¶
Bases:
int
- baseClass¶
alias of
QgsAttributeEditorContext
- MultiEditMode = 3¶
- Multiple = 1¶
- Popup = 2¶
- class RelationMode¶
Bases:
int
- SearchMode = 4¶
- Single = 2¶
- SingleEditMode = 0¶
- StandaloneDialog = 1¶
- Undefined = 0¶
- allowCustomUi(self) bool ¶
Returns
True
if the attribute editor should permit use of custom UI forms.See also
New in version 2.16.
- Return type
bool
- attributeFormMode(self) QgsAttributeEditorContext.Mode ¶
Returns current attributeFormMode
New in version 3.4.
- Return type
- attributeFormModeString(self) str ¶
Returns given
attributeFormMode
as stringNew in version 3.4.
- Return type
str
- cadDockWidget(self) QgsAdvancedDigitizingDockWidget ¶
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
New in version 3.10.
- Return type
- distanceArea(self) QgsDistanceArea ¶
Returns the distance area object used for area/length calculations.
See also
New in version 2.2.
- Return type
- formFeature(self) QgsFeature ¶
Returns current feature from the currently edited form or table row
See also
New in version 3.2.
- Return type
- formMode(self) QgsAttributeEditorContext.FormMode ¶
Returns the form mode.
See also
- Return type
- mainMessageBar(self) QgsMessageBar ¶
Returns the main message bar
New in version 3.12.
- Return type
- mapCanvas(self) QgsMapCanvas ¶
Returns the associated map canvas (e.g. to zoom to related features).
See also
New in version 3.2.
- Return type
- parentContext(self) QgsAttributeEditorContext ¶
- Return type
- parentFormFeature(self) QgsFeature ¶
Returns the feature of the currently edited parent form in its actual state
See also
New in version 3.14.
- Return type
- relation(self) QgsRelation ¶
Returns the attribute relation.
See also
See also
New in version 2.6.
- Return type
- relationMode(self) QgsAttributeEditorContext.RelationMode ¶
Returns the attribute relation mode.
See also
See also
New in version 2.6.
- Return type
- setAllowCustomUi(self, allow: bool)¶
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
New in version 2.16.
- setAttributeFormMode(self, attributeFormMode: QgsAttributeEditorContext.Mode)¶
Set
attributeFormMode
for the edited formNew in version 3.4.
- Parameters
attributeFormMode (QgsAttributeEditorContext.Mode) –
- setCadDockWidget(self, cadDockWidget: QgsAdvancedDigitizingDockWidget)¶
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
New in version 3.10.
- Parameters
cadDockWidget (QgsAdvancedDigitizingDockWidget) –
- setDistanceArea(self, distanceArea: QgsDistanceArea)¶
Sets distance area object,
distanceArea
, for area/length calculationsSee also
New in version 2.2.
- Parameters
distanceArea (QgsDistanceArea) –
- setFormFeature(self, feature: QgsFeature)¶
Set current
feature
for the currently edited form or table rowSee also
New in version 3.2.
- Parameters
feature (QgsFeature) –
- setFormMode(self, mode: QgsAttributeEditorContext.FormMode)¶
Sets the form mode.
- Parameters
mode (QgsAttributeEditorContext.FormMode) – form mode
See also
New in version 2.16.
- setMainMessageBar(self, messageBar: QgsMessageBar)¶
Set current
messageBar
as the main message barNew in version 3.12.
- Parameters
messageBar (QgsMessageBar) –
- setMapCanvas(self, mapCanvas: QgsMapCanvas)¶
Sets the associated map canvas,
mapCanvas
, (e.g. to zoom to related features).See also
New in version 3.2.
- Parameters
mapCanvas (QgsMapCanvas) –
- setParentFormFeature(self, feature: QgsFeature)¶
Sets the
feature
of the currently edited parent formSee also
New in version 3.14.
- Parameters
feature (QgsFeature) –
- setRelation(self, relation: QgsRelation, mode: QgsAttributeEditorContext.RelationMode)¶
Set attribute relation and mode
- Parameters
relation (QgsRelation) – relation
mode (QgsAttributeEditorContext.RelationMode) – relation mode
See also
See also
New in version 2.6.
- setVectorLayerTools(self, vlTools: QgsVectorLayerTools)¶
Sets the associated vector layer tools.
- Parameters
vlTools (QgsVectorLayerTools) – vector layer tools
See also
New in version 2.2.
- staticMetaObject = <PyQt5.QtCore.QMetaObject object>¶
- vectorLayerTools(self) QgsVectorLayerTools ¶
Returns the associated vector layer tools.
See also
New in version 2.2.
- Return type