Class: QgsAttributeDialog

QgsAttributeDialog in QgsAttributeEditorContext.Mode.SingleEditMode

QgsAttributeDialog in QgsAttributeEditorContext.Mode.SingleEditMode

Class Hierarchy

Inheritance diagram of qgis.gui.QgsAttributeDialog

Base classes

QDialog

QWidget

QObject

QPaintDevice

QgsMapLayerActionContextGenerator

An interface for objects which can create a QgsMapLayerActionContext.

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()
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.

show(self)[source]

Show the dialog non-blocking. Reparents this dialog to be a child of the dialog form