Class: QgsAttributeDialog

class qgis.gui.QgsAttributeDialog(vl: QgsVectorLayer | None, thepFeature: QgsFeature | None, featureOwner: bool, parent: QWidget | None = None, showDialogButtons: bool = True, context: QgsAttributeEditorContext = QgsAttributeEditorContext())

Bases: PyQt5.QtWidgets.QDialog, QgsMapLayerActionContextGenerator

Create an attribute dialog for a given layer and feature

Parameters:
accept(self)
actionEvent(self, a0: QActionEvent | None)
attributeForm(self) QgsAttributeForm | None
Return type:

Optional[QgsAttributeForm]

changeEvent(self, a0: QEvent | None)
childEvent(self, a0: QChildEvent | None)
closeEvent(self, a0: QCloseEvent | None)
connectNotify(self, signal: QMetaMethod)
contextMenuEvent(self, a0: QContextMenuEvent | None)
create(self, window: PyQt5.sip.voidptr = None, initializeWindow: bool = True, destroyOldWindow: bool = True)
createActionContext(self) QgsMapLayerActionContext
Return type:

QgsMapLayerActionContext

customEvent(self, a0: QEvent | None)
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, signal: QMetaMethod)
dragEnterEvent(self, a0: QDragEnterEvent | None)
dragLeaveEvent(self, a0: QDragLeaveEvent | None)
dragMoveEvent(self, a0: QDragMoveEvent | None)
dropEvent(self, a0: QDropEvent | None)
editable(self) bool

Is this dialog editable?

Return type:

bool

Returns:

returns True, if this dialog was created in an editable manner.

enterEvent(self, a0: QEvent | None)
event(self, e: QEvent | None) bool

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

eventFilter(self, a0: QObject | None, a1: QEvent | None) bool
feature(self) QgsFeature | None
Return type:

Optional[QgsFeature]

focusInEvent(self, a0: QFocusEvent | None)
focusNextChild(self) bool
focusNextPrevChild(self, next: bool) bool
focusOutEvent(self, a0: QFocusEvent | None)
focusPreviousChild(self) bool
hideEvent(self, a0: QHideEvent | None)
initPainter(self, painter: QPainter | None)
inputMethodEvent(self, a0: QInputMethodEvent | None)
isSignalConnected(self, signal: QMetaMethod) bool
keyPressEvent(self, a0: QKeyEvent | None)
keyReleaseEvent(self, a0: QKeyEvent | None)
leaveEvent(self, a0: QEvent | None)
metric(self, a0: QPaintDevice.PaintDeviceMetric) int
mouseDoubleClickEvent(self, a0: QMouseEvent | None)
mouseMoveEvent(self, a0: QMouseEvent | None)
mousePressEvent(self, a0: QMouseEvent | None)
mouseReleaseEvent(self, a0: QMouseEvent | None)
moveEvent(self, a0: QMoveEvent | None)
nativeEvent(self, eventType: QByteArray | bytes | bytearray, message: PyQt5.sip.voidptr | None)
paintEvent(self, a0: QPaintEvent | None)
receivers(self, signal: PYQT_SIGNAL) int
reject(self)
resizeEvent(self, a0: QResizeEvent | None)
sender(self) QObject | None
senderSignalIndex(self) int
setEditCommandMessage(self, message: str | None)

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)

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)
setHighlight(None) None
Parameters:

h (Optional[QgsHighlight]) – The highlight. Ownership is taken.

setMode(self, mode: QgsAttributeEditorContext.Mode)

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.

sharedPainter(self) QPainter | None
show(self)

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

showEvent(self, event: QShowEvent | None)
Parameters:

event (Optional[QShowEvent])

tabletEvent(self, a0: QTabletEvent | None)
timerEvent(self, a0: QTimerEvent | None)
updateMicroFocus(self)
wheelEvent(self, a0: QWheelEvent | None)