Class: QgsAttributeDialog¶

QgsAttributeDialog in QgsAttributeEditorContext.Mode.SingleEditMode¶
Class Hierarchy¶
Base classes¶
An interface for objects which can create a |
Methods
Is this dialog editable? |
|
Intercept window activate/deactivate events to show/hide the highlighted feature. |
|
Sets the edit command message (Undo) that will be used when the dialog is accepted |
|
Sets extraScope as an additional expression context scope to be used for calculations in this form. |
|
setHighlight |
|
Toggles the form mode. |
|
Show the dialog non-blocking. |
- class qgis.gui.QgsAttributeDialog(vl: QgsVectorLayer | None, thepFeature: QgsFeature | None, featureOwner: bool, parent: QWidget | None = None, showDialogButtons: bool = True, context: QgsAttributeEditorContext = QgsAttributeEditorContext())[source]¶
Bases:
QDialog
,QgsMapLayerActionContextGenerator
- attributeForm(self) QgsAttributeForm | None [source]¶
- Return type:
Optional[QgsAttributeForm]
- editable(self) bool [source]¶
Is this dialog editable?
- Return type:
bool
- Returns:
returns
True
, if this dialog was created in an editable manner.
- event(self, e: QEvent | None) bool [source]¶
Intercept window activate/deactivate events to show/hide the highlighted feature.
- Parameters:
e (Optional[QEvent]) – The event
- Return type:
bool
- Returns:
The same as the parent QDialog
- feature(self) QgsFeature | None [source]¶
- Return type:
Optional[QgsFeature]
- setEditCommandMessage(self, message: str | None)[source]¶
Sets the edit command message (Undo) that will be used when the dialog is accepted
- Parameters:
message (Optional[str]) – The message
- setExtraContextScope(self, extraScope: QgsExpressionContextScope | None)[source]¶
Sets
extraScope
as an additional expression context scope to be used for calculations in this form.Added in version 3.16.
- Parameters:
extraScope (Optional[QgsExpressionContextScope])
- setHighlight(self, h: QgsHighlight | None)[source]¶
- setHighlight(None) None
- Parameters:
h (Optional[QgsHighlight]) – The highlight. Ownership is taken.
- setMode(self, mode: QgsAttributeEditorContext.Mode)[source]¶
Toggles the form mode.
- Parameters:
mode (QgsAttributeEditorContext.Mode) – form mode. For example, if set to
QgsAttributeEditorContext
.AddFeatureMode, the dialog will be editable even with an invalid feature and will add a new feature when the form is accepted.