Class: QgsAttributeEditorRelation

class qgis.core.QgsAttributeEditorRelation(name: str, relationId: str, parent: QgsAttributeEditorElement)

Bases: QgsAttributeEditorElement

Deprecated since version QGIS: 3.0.2. The name parameter is not used for anything and overwritten by the relationId internally.

QgsAttributeEditorRelation(name: str, relation: QgsRelation, parent: QgsAttributeEditorElement)

Deprecated since version QGIS: 3.0.2. The name parameter is not used for anything and overwritten by the relationId internally.

QgsAttributeEditorRelation(relationId: str, parent: QgsAttributeEditorElement) Creates a new element which embeds a relation.

Parameters

QgsAttributeEditorRelation(relation: QgsRelation, parent: QgsAttributeEditorElement) Creates a new element which embeds a relation.

Parameters
  • relation – The relation to embed

  • parent – The parent (used as container)

QgsAttributeEditorRelation(QgsAttributeEditorRelation)

This element will load a relation editor onto the form.

Parameters

name

clone(self, parent: QgsAttributeEditorElement)QgsAttributeEditorElement
Parameters

parent (QgsAttributeEditorElement) –

Return type

QgsAttributeEditorElement

init(self, relManager: QgsRelationManager) → bool

Initializes the relation from the id

Parameters

relManager (QgsRelationManager) – The relation manager to use for the initialization

Return type

bool

Returns

True if the relation was found in the relationmanager

relation(self)QgsRelation

Gets the id of the relation which shall be embedded

Return type

QgsRelation

Returns

the id

setShowLinkButton(self, showLinkButton: bool)

Determines if the “link feature” button should be shown

New in version 2.18.

Parameters

showLinkButton (bool) –

setShowSaveChildEditsButton(self, showSaveChildEditsButton: bool)

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

New in version 3.14.

Parameters

showSaveChildEditsButton (bool) –

setShowUnlinkButton(self, showUnlinkButton: bool)

Determines if the “unlink feature” button should be shown

New in version 2.18.

Parameters

showUnlinkButton (bool) –

showLinkButton(self) → bool

Determines if the “link feature” button should be shown

New in version 2.18.

Return type

bool

showSaveChildEditsButton(self) → bool

Returns True 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