Class: QgsRelationEditorWidget

class qgis.gui.QgsRelationEditorWidget(parent: QWidget = None)

Bases: QgsCollapsibleGroupBox

Parameters

parent (QWidget = None) –

parent widget

Methods

actionEvent

changeEvent

childEvent

clearModifiers

closeEvent

collapseExpandFixes

connectNotify

contextMenuEvent

create

customEvent

destroy

disconnectNotify

dragEnterEvent

dragLeaveEvent

dragMoveEvent

dropEvent

enterEvent

event

feature

Returns the widget’s current feature

featureSelectionManager

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

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

hideEvent

init

initPainter

initStyleOption

inputMethodEvent

isSignalConnected

keyPressEvent

keyReleaseEvent

leaveEvent

loadState

metric

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

moveEvent

nativeEvent

paintEvent

parentFormValueChanged

Called when an attribute value in the parent widget has changed to newValue

receivers

resizeEvent

saveKey

saveState

sender

senderSignalIndex

setEditorContext

Sets the editor context

setFeature

Sets the feature being edited and updates the UI unless update is set to False

setRelationFeature

Sets the relation and the feature

setRelations

Set the relation(s) for this widget If only one relation is set, it will act as a simple 1:N relation widget If both relations are set, it will act as an N:M relation widget inserting and deleting entries on the intermediate table as required.

setShowLabel

Defines if a title label should be shown for this widget.

setShowLinkButton

Determines if the “link feature” button should be shown

setShowSaveChildEditsButton

Determines if the “Save child layer edits” button should be shown

setShowUnlinkButton

Determines if the “unlink feature” button should be shown

setViewMode

Define the view mode for the dual view

sharedPainter

showEvent

showLabel

Defines if a title label should be shown for this widget.

showLinkButton

Determines if the “link feature” button should be shown

showSaveChildEditsButton

Determines if the “Save child layer edits” button should be shown

showUnlinkButton

Determines if the “unlink feature” button should be shown

tabletEvent

timerEvent

titleRect

updateMicroFocus

updateStyle

viewMode

Gets the view mode for the dual view

wheelEvent

actionEvent()
changeEvent()
childEvent()
clearModifiers()
closeEvent()
collapseExpandFixes()
connectNotify()
contextMenuEvent()
create()
customEvent()
destroy()
disconnectNotify()
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
dropEvent()
enterEvent()
event()
feature(self)QgsFeature

Returns the widget’s current feature

New in version 3.14.

Return type

QgsFeature

featureSelectionManager(self)QgsIFeatureSelectionManager

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

Return type

QgsIFeatureSelectionManager

focusInEvent()
focusNextChild()
focusNextPrevChild()
focusOutEvent()
focusPreviousChild()
hideEvent()
init()
initPainter()
initStyleOption()
inputMethodEvent()
isSignalConnected()
keyPressEvent()
keyReleaseEvent()
leaveEvent()
loadState()
metric()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
moveEvent()
nativeEvent()
paintEvent()
parentFormValueChanged(self, attribute: str, newValue: Any)

Called when an attribute value in the parent widget has changed to newValue

New in version 3.14.

Parameters
  • attribute (str) –

  • newValue (Any) –

receivers()
resizeEvent()
saveKey()
saveState()
sender()
senderSignalIndex()
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) –

setFeature(self, feature: QgsFeature, update: bool = True)

Sets the feature being edited and updates the UI unless update is set to False

Parameters
  • feature (QgsFeature) –

  • update (bool = True) –

setRelationFeature(self, relation: QgsRelation, feature: QgsFeature)

Sets the relation and the feature

Parameters
setRelations(self, relation: QgsRelation, nmrelation: QgsRelation)

Set the relation(s) for this widget If only one relation is set, it will act as a simple 1:N relation widget If both relations are set, it will act as an N:M relation widget inserting and deleting entries on the intermediate table as required.

Parameters
  • relation (QgsRelation) – Relation referencing the edited table

  • nmrelation (QgsRelation) – Optional reference from the referencing table to a 3rd N:M table

setShowLabel(self, showLabel: bool)

Defines if a title label should be shown for this widget.

New in version 2.18.

Parameters

showLabel (bool) –

setShowLinkButton(self, showLinkButton: bool)

Determines if the “link feature” button should be shown

New in version 2.18.

Parameters

showLinkButton (bool) –

setShowSaveChildEditsButton(self, showChildEdits: bool)

Determines if the “Save child layer edits” button should be shown

New in version 3.14.

Parameters

showChildEdits (bool) –

setShowUnlinkButton(self, showUnlinkButton: bool)

Determines if the “unlink feature” button should be shown

New in version 2.18.

Parameters

showUnlinkButton (bool) –

setViewMode(self, mode: QgsDualView.ViewMode)

Define the view mode for the dual view

Parameters

mode (QgsDualView.ViewMode) –

sharedPainter()
showEvent()
showLabel(self) → bool

Defines if a title label should be shown for this widget.

New in version 2.18.

Return type

bool

showLinkButton(self) → bool

Determines if the “link feature” button should be shown

New in version 2.18.

Return type

bool

showSaveChildEditsButton(self) → bool

Determines if the “Save child layer edits” button should be shown

New in version 3.14.

Return type

bool

showUnlinkButton(self) → bool

Determines if the “unlink feature” button should be shown

New in version 2.18.

Return type

bool

tabletEvent()
timerEvent()
titleRect()
updateMicroFocus()
updateStyle()
viewMode(self) → QgsDualView.ViewMode

Gets the view mode for the dual view

Return type

QgsDualView.ViewMode

wheelEvent()