Class: QgsAttributeEditorRelation¶
- class qgis.core.QgsAttributeEditorRelation¶
Bases:
QgsAttributeEditorElement
This element will load a relation editor onto the form.
QgsAttributeEditorRelation(name: str, relationId: str, parent:
QgsAttributeEditorElement
)Deprecated since version QGIS: 3.16
QgsAttributeEditorRelation(name: str, relation:
QgsRelation
, parent:QgsAttributeEditorElement
)Deprecated since version QGIS: 3.16
QgsAttributeEditorRelation(relationId: str, parent:
QgsAttributeEditorElement
) Creates a new element which embeds a relation.- Parameters:
relationId – The id of the relation to embed
parent – The parent (used as container)
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
)Methods
- param parent:
Determines the force suppress form popup status.
Initializes the relation from the id
Determines the label of this element
Determines the relation id of the second relation involved in an N:M relation.
Gets the id of the relation which shall be embedded
Returns the relation editor widget configuration
Returns the current relation widget type id
Sets force suppress form popup status to
forceSuppressFormPopup
.Sets
label
for this element If it's empty it takes the relation id as labelSets
nmRelationId
for the relation id of the second relation involved in an N:M relation.Sets the relation editor configuration
Sets the relation widget type
Attributes
- AddChildFeature = 16¶
- AllButtons = 254¶
- class Button¶
Bases:
int
- baseClass¶
alias of
QgsAttributeEditorRelation
- class Buttons¶
- class Buttons(Union[QgsAttributeEditorRelation.Buttons, QgsAttributeEditorRelation.Button])
- class Buttons(QgsAttributeEditorRelation.Buttons)
Bases:
sip.wrapper
- baseClass¶
alias of
QgsAttributeEditorRelation
- DeleteChildFeature = 64¶
- DuplicateChildFeature = 32¶
- Link = 2¶
- SaveChildEdits = 8¶
- Unlink = 4¶
- ZoomToChildFeature = 128¶
- clone(self, parent: QgsAttributeEditorElement) QgsAttributeEditorElement ¶
- Parameters:
parent (QgsAttributeEditorElement)
- Return type:
- forceSuppressFormPopup(self) bool ¶
Determines the force suppress form popup status.
Added 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
Added in version 3.16.
- Return type:
str
- nmRelationId(self) Any ¶
Determines the relation id of the second relation involved in an N:M relation.
Added in version 3.16.
- Return type:
Any
- relation(self) QgsRelation ¶
Gets the id of the relation which shall be embedded
- Return type:
- Returns:
the id
- relationEditorConfiguration(self) Dict[str, Any] ¶
Returns the relation editor widget configuration
Added in version 3.18.
- Return type:
Dict[str, Any]
- relationWidgetTypeId(self) str ¶
Returns the current relation widget type id
Added in version 3.18.
- Return type:
str
- 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.Added 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 labelAdded 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.Added in version 3.16.
- Parameters:
nmRelationId (Any = None)
- setRelationEditorConfiguration(self, config: Dict[str, Any])¶
Sets the relation editor configuration
Added in version 3.18.
- Parameters:
config (Dict[str)
- setRelationWidgetTypeId(self, relationWidgetTypeId: str)¶
Sets the relation widget type
Added in version 3.18.
- Parameters:
relationWidgetTypeId (str)
- staticMetaObject = <PyQt5.QtCore.QMetaObject object>¶