Class: QgsAttributeDialog

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

Bases: PyQt5.QtWidgets.QDialog

Create an attribute dialog for a given layer and feature

Parameters
accept(self)
actionEvent(self, QActionEvent)
attributeForm(self) QgsAttributeForm
Return type

QgsAttributeForm

changeEvent(self, QEvent)
childEvent(self, QChildEvent)
closeEvent(self, QCloseEvent)
connectNotify(self, QMetaMethod)
contextMenuEvent(self, QContextMenuEvent)
create(self, window: sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
customEvent(self, QEvent)
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, QMetaMethod)
dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
dropEvent(self, QDropEvent)
editable(self) bool

Is this dialog editable?

Return type

bool

Returns

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

enterEvent(self, QEvent)
event(self, e: QEvent) bool

Intercept window activate/deactivate events to show/hide the highlighted feature.

Parameters

e (QEvent) – The event

Return type

bool

Returns

The same as the parent QDialog

eventFilter(self, QObject, QEvent) bool
feature(self) QgsFeature
Return type

QgsFeature

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

Sets the edit command message (Undo) that will be used when the dialog is accepted

Parameters

message (str) – The message

setExtraContextScope(self, extraScope: QgsExpressionContextScope)

Sets extraScope as an additional expression context scope to be used for calculations in this form.

New in version 3.16.

Parameters

extraScope (QgsExpressionContextScope) –

setHighlight(self, h: QgsHighlight)
setHighlight(None) None
Parameters

h (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
show(self)

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

showEvent(self, QShowEvent)
tabletEvent(self, QTabletEvent)
timerEvent(self, QTimerEvent)
updateMicroFocus(self)
wheelEvent(self, QWheelEvent)