Subgroup: Attribute

Class: QgsAttributeEditorRelation

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

Bases: qgis._core.QgsAttributeEditorElement

Creates a new element which embeds a relation.

Parameters:
  • name – The name of this element
  • relationId – The id of the relation to embed
  • parent – The parent (used as container)

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

Parameters:
  • name – The name of this element
  • relation – The relation to embed
  • parent – The parent (used as container)

QgsAttributeEditorRelation(QgsAttributeEditorRelation)

This element will load a relation editor onto the form.

Methods

clone
init Initializes the relation from the id
relation Get the id of the relation which shall be embedded
setShowLinkButton Determines if the “link feature” button should be shown
setShowUnlinkButton Determines if the “unlink feature” button should be shown
showLinkButton Determines if the “link feature” button should be shown
showUnlinkButton Determines if the “unlink feature” button should be shown

Signals

Attributes

clone(self, parent: QgsAttributeEditorElement) → QgsAttributeEditorElement
init(self, relManager: QgsRelationManager) → bool

Initializes the relation from the id

Parameters:relManager – The relation manager to use for the initialization
Returns:true if the relation was found in the relationmanager
relation(self) → QgsRelation

Get the id of the relation which shall be embedded

Returns:the id
setShowLinkButton(self, showLinkButton: bool)

Determines if the “link feature” button should be shown

New in version 2.18.

setShowUnlinkButton(self, showUnlinkButton: bool)

Determines if the “unlink feature” button should be shown

New in version 2.18.

showLinkButton(self) → bool

Determines if the “link feature” button should be shown

New in version 2.18.

showUnlinkButton(self) → bool

Determines if the “unlink feature” button should be shown

New in version 2.18.