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

AddChildFeature = 16
AllButtons = 254
class Button

Bases: int

baseClass

alias of QgsAttributeEditorRelation

class Buttons

Bases: sip.wrapper

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

baseClass

alias of QgsAttributeEditorRelation

DeleteChildFeature = 64
DuplicateChildFeature = 32
SaveChildEdits = 8
ZoomToChildFeature = 128
clone(self, parent: QgsAttributeEditorElement)QgsAttributeEditorElement
Parameters

parent (QgsAttributeEditorElement) –

Return type

QgsAttributeEditorElement

forceSuppressFormPopup(self) → bool

Determines the force suppress form popup status.

New in version 3.16.

Return type

bool

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

label(self) → str

Determines the label of this element

New in version 3.16.

Return type

str

nmRelationId(self) → Any

Determines the relation id of the second relation involved in an N:M relation.

New in version 3.16.

Return type

Any

relation(self)QgsRelation

Gets the id of the relation which shall be embedded

Return type

QgsRelation

Returns

the id

setForceSuppressFormPopup(self, forceSuppressFormPopup: bool)

Sets force suppress form popup status to forceSuppressFormPopup. This flag is to override the layer and general settings regarding the automatic opening of the attribute form dialog when digitizing is completed.

New in version 3.16.

Parameters

forceSuppressFormPopup (bool) –

setLabel(self, label: str = '')

Sets label for this element If it’s empty it takes the relation id as label

New in version 3.16.

Parameters

label (str = '') –

setNmRelationId(self, nmRelationId: Any = None)

Sets nmRelationId for the relation id of the second relation involved in an N:M relation. If it’s empty, then it’s considered as a 1:M relationship.

New in version 3.16.

Parameters

nmRelationId (Any = None) –

setShowLinkButton(self, showLinkButton: bool)

Determines if the “link feature” button should be shown

New in version 2.18.

Deprecated since version QGIS: 3.16 use setVisibleButtons() instead

Parameters

showLinkButton (bool) –

setShowSaveChildEditsButton(self, showChildEdits: bool)

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

New in version 3.14.

Deprecated since version QGIS: 3.16 use setVisibleButtons() instead

Parameters

showChildEdits (bool) –

setShowUnlinkButton(self, showUnlinkButton: bool)

Determines if the “unlink feature” button should be shown

New in version 2.18.

Deprecated since version QGIS: 3.16 use setVisibleButtons() instead

Parameters

showUnlinkButton (bool) –

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

Defines the buttons which are shown

New in version 3.16.

Parameters

buttons (Union[QgsAttributeEditorRelation.Buttons) –

showLinkButton(self) → bool

Determines if the “link feature” button should be shown

New in version 2.18.

Deprecated since version QGIS: 3.16 use visibleButtons() instead

Return type

bool

showSaveChildEditsButton(self) → bool

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

New in version 3.14.

Deprecated since version QGIS: 3.16 use visibleButtons() instead

Return type

bool

showUnlinkButton(self) → bool

Determines if the “unlink feature” button should be shown

New in version 2.18.

Deprecated since version QGIS: 3.16 use visibleButtons() instead

Return type

bool

staticMetaObject = <PyQt5.QtCore.QMetaObject object>
visibleButtons(self)QgsAttributeEditorRelation.Buttons

Returns the buttons which are shown

New in version 3.16.

Return type

QgsAttributeEditorRelation.Buttons