Class: QgsRelationEditorWidget

class qgis.gui.QgsRelationEditorWidget(config: Dict[str, Any], parent: QWidget = None)

Bases: QgsAbstractRelationEditorWidget

Constructor

Parameters
  • config (Dict[str) – widget configuration

  • parent (QWidget = None) – parent widget

The default relation widget in QGIS. Successor of the now deprecated {QgsRelationEditorWidget}.

Methods

actionEvent

addFeature

Adds a new feature with given geometry

changeEvent

childEvent

closeEvent

config

Returns the current configuration

connectNotify

contextMenuEvent

create

customEvent

deleteFeature

Delete a feature with given fid

deleteFeatures

Deletes the features with fids

deleteSelectedFeatures

Deletes the currently selected features

destroy

disconnectNotify

dragEnterEvent

dragLeaveEvent

dragMoveEvent

dropEvent

duplicateFeature

Duplicates a feature

duplicateFeatures

Duplicates features

duplicateSelectedFeatures

Duplicates the selected features

enterEvent

event

featureSelectionManager

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

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

hideEvent

initPainter

inputMethodEvent

isSignalConnected

keyPressEvent

keyReleaseEvent

leaveEvent

linkFeature

Links a new feature to the relation

metric

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

moveEvent

nativeEvent

onLinkFeatureDlgAccepted

Called when the link feature dialog is confirmed by the user

paintEvent

parentFormValueChanged

param attribute

receivers

resizeEvent

saveEdits

Saves the current modifications in the relation

sender

senderSignalIndex

setConfig

Defines the current configuration

setEditorContext

Sets the editor context

setTitle

Sets the title of the root groupbox

setViewMode

Define the view mode for the dual view

setVisibleButtons

Defines the buttons which are shown

sharedPainter

showEvent

tabletEvent

timerEvent

toggleEditing

Toggles editing state of the widget

unlinkFeature

Unlinks a feature with given fid

unlinkFeatures

Unlinks the features with fids

unlinkSelectedFeatures

Unlinks the selected features from the relation

updateMicroFocus

updateTitle

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

viewMode

Gets the view mode for the dual view

visibleButtons

Returns the buttons which are shown

wheelEvent

zoomToSelectedFeatures

Zooms to the selected features

Attributes

AddChildFeature

AllButtons

DeleteChildFeature

DuplicateChildFeature

Link

SaveChildEdits

Unlink

ZoomToChildFeature

AddChildFeature = 16
AllButtons = 254
class Button

Bases: int

baseClass

alias of qgis._gui.QgsRelationEditorWidget

class Buttons

Bases: sip.wrapper

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

baseClass

alias of qgis._gui.QgsRelationEditorWidget

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

Adds a new feature with given geometry

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 root groupbox

Parameters

title (str) –

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

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