Class: QgsRelationEditorWidget

class qgis.gui.QgsRelationEditorWidget

Bases: QgsAbstractRelationEditorWidget

The default relation widget in QGIS.

New in version 3.18.

QgsRelationEditorWidget(config: Dict[str, Any], parent: QWidget = None) Constructor

Parameters
AddChildFeature = 16
AllButtons = 254
class Button

Bases: int

baseClass

alias of qgis._gui.QgsRelationEditorWidget

class Buttons
class Buttons(Union[QgsRelationEditorWidget.Buttons, QgsRelationEditorWidget.Button])None
class Buttons(QgsRelationEditorWidget.Buttons)None

Bases: sip.wrapper

baseClass

alias of qgis._gui.QgsRelationEditorWidget

DeleteChildFeature = 64
DuplicateChildFeature = 32
NoButton = 0
SaveChildEdits = 8
ZoomToChildFeature = 128
actionEvent(self, QActionEvent)
addFeature(self, geometry: QgsGeometry = QgsGeometry())

Adds a new feature with given geometry

afterSetRelationFeature(self)
afterSetRelations(self)
beforeSetRelationFeature(self, newRelation: QgsRelation, newFeature: QgsFeature)
Parameters
beforeSetRelations(self, newRelation: QgsRelation, newNmRelation: QgsRelation)
Parameters
changeEvent(self, QEvent)
childEvent(self, QChildEvent)
closeEvent(self, QCloseEvent)
config(self)Dict[str, Any]

Returns the current configuration

Return type

Dict[str, Any]

connectNotify(self, QMetaMethod)
contextMenuEvent(self, QContextMenuEvent)
create(self, window: sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
customEvent(self, QEvent)
deleteFeature(self, fid: int =  ::QgsFeatureId())

Delete a feature with given fid

deleteFeatures(self, fids: object)

Deletes the features with fids

deleteSelectedFeatures(self)

Deletes the currently selected features

destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, QMetaMethod)
dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
dropEvent(self, QDropEvent)
duplicateFeature(self)

Duplicates a feature

Deprecated since version QGIS: 3.18 use duplicateSelectedFeatures() instead

duplicateFeatures(self, fids: object)

Duplicates features

duplicateSelectedFeatures(self)

Duplicates the selected features

New in version 3.18.

enterEvent(self, QEvent)
event(self, QEvent)bool
featureSelectionManager(self)QgsIFeatureSelectionManager

The feature selection manager is responsible for the selected features which are currently being edited.

Return type

QgsIFeatureSelectionManager

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)
linkFeature(self)

Links a new feature to the relation

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]
onLinkFeatureDlgAccepted(self)

Called when the link feature dialog is confirmed by the user

paintEvent(self, QPaintEvent)
parentFormValueChanged(self, attribute: str, newValue: Any)
Parameters
  • attribute (str) –

  • newValue (Any) –

receivers(self, PYQT_SIGNAL)int
resizeEvent(self, QResizeEvent)
saveEdits(self)

Saves the current modifications in the relation

sender(self)QObject
senderSignalIndex(self)int
setConfig(self, config: Dict[str, Any])

Defines the current configuration

Parameters

config (Dict[str) –

setEditorContext(self, context: QgsAttributeEditorContext)

Sets the editor context

Note

if context cadDockWidget is null, it won’t be possible to digitize the geometry of a referencing feature from this widget

Parameters

context (QgsAttributeEditorContext) –

setTitle(self, title: str)

Sets the title of the widget, if it is wrapped within a QgsCollapsibleGroupBox

Deprecated since version QGIS: 3.20 label is handled directly in QgsAttributeForm.

setViewMode(self, mode: QgsDualView.ViewMode)

Define the view mode for the dual view

Parameters

mode (QgsDualView.ViewMode) –

setVisibleButtons(self, buttons: Union[QgsRelationEditorWidget.Buttons, QgsRelationEditorWidget.Button])

Defines the buttons which are shown

Parameters

buttons (Union[QgsRelationEditorWidget.Buttons) –

sharedPainter(self)QPainter
showEvent(self, QShowEvent)

Refresh the UI when the widget becomes visible

tabletEvent(self, QTabletEvent)
timerEvent(self, QTimerEvent)
toggleEditing(self, state: bool)

Toggles editing state of the widget

unlinkFeature(self, fid: int =  ::QgsFeatureId())

Unlinks a feature with given fid

unlinkFeatures(self, fids: object)

Unlinks the features with fids

unlinkSelectedFeatures(self)

Unlinks the selected features from the relation

updateMicroFocus(self)
updateTitle(self)

Updates the title contents to reflect the current state of the widget

Deprecated since version QGIS: 3.20 label is handled directly in QgsAttributeForm.

updateUi(self)
viewMode(self)QgsDualView.ViewMode

Gets the view mode for the dual view

Return type

QgsDualView.ViewMode

visibleButtons(self)QgsRelationEditorWidget.Buttons

Returns the buttons which are shown

Return type

QgsRelationEditorWidget.Buttons

wheelEvent(self, QWheelEvent)
zoomToSelectedFeatures(self)

Zooms to the selected features