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
vl – The layer for which the dialog will be generated
thepFeature – A feature for which the dialog will be generated
featureOwner – Set to
True
, if the dialog should take ownership of the featureparent – A parent widget for the dialog
showDialogButtons –
True
: Show the dialog buttons accept/cancelcontext –
The context in which this dialog is created
Methods
- rtype
QgsAttributeForm
Is this dialog editable?
Intercept window activate/deactivate events to show/hide the highlighted feature.
- rtype
QgsFeature
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.- type h
QgsHighlight
Toggles the form mode.
Show the dialog non-blocking.
- accept(self)¶
- actionEvent(self, QActionEvent)¶
- attributeForm(self) QgsAttributeForm ¶
- Return type
- 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
- 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.
- 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)¶