Class: QgsRelationWidgetWrapper¶
Class Hierarchy¶
Base classes¶
Manages an editor widget Widget and wrapper share the same parent |
|
Methods
Determines the force suppress form popup status that is configured for this widget |
|
Determines the label of this element |
|
Determines the relation id of the second relation involved in an N:M relation. |
|
The relation for which this wrapper is created. |
|
Sets force suppress form popup status to forceSuppressFormPopup for this widget and for the vectorLayerTools (if |
|
Sets label for this element If it's empty it takes the relation id as label |
|
Set multiple feature to edit simultaneously. |
|
Sets nmRelationId for the relation id of the second relation involved in an N:M relation. |
|
Defines if a title label should be shown for this widget. |
|
Determines if the "link feature" button should be shown |
|
Determines if the "Save child layer edits" button should be shown |
|
Determines if the "unlink feature" button should be shown |
|
Sets the visibility of the wrapper's widget. |
|
Defines the buttons which are shown |
|
Will set the config of this widget wrapper to the specified config. |
|
Defines if a title label should be shown for this widget. |
|
Determines if the "link feature" button should be shown |
|
Determines if the "Save child layer edits" button should be shown |
|
Determines if the "unlink feature" button should be shown |
|
Returns the buttons which are shown |
|
Returns the whole widget config |
|
Will be called when a value in the current edited form or table row changes |
Signals
Emit this signal, whenever the related features changed. |
- class qgis.gui.QgsRelationWidgetWrapper(vl: QgsVectorLayer | None, relation: QgsRelation, editor: QWidget | None = None, parent: QWidget | None = None)[source]¶
Bases:
QgsWidgetWrapper
- __init__(relationEditorName: str | None, vl: QgsVectorLayer | None, relation: QgsRelation, editor: QWidget | None = None, parent: QWidget | None = None)
Constructor for QgsRelationWidgetWrapper
- Parameters:
relationEditorName (Optional[str])
vl (Optional[QgsVectorLayer])
relation (QgsRelation)
editor (Optional[QWidget] = None)
parent (Optional[QWidget] = None)
- forceSuppressFormPopup(self) bool [source]¶
Determines the force suppress form popup status that is configured for this widget
Added in version 3.16.
- Return type:
bool
- label(self) str [source]¶
Determines the label of this element
Added in version 3.16.
Deprecated since version 3.20: Label is handled directly in
QgsAttributeForm
.- Return type:
str
- nmRelationId(self) Any [source]¶
Determines the relation id of the second relation involved in an N:M relation.
Added in version 3.16.
- Return type:
Any
Emit this signal, whenever the related features changed. This happens for example when related features are added, removed, linked or unlinked.
Added in version 3.22.
- relation(self) QgsRelation [source]¶
The relation for which this wrapper is created.
- Return type:
- setForceSuppressFormPopup(self, forceSuppressFormPopup: bool)[source]¶
Sets force suppress form popup status to
forceSuppressFormPopup
for this widget and for the vectorLayerTools (ifTrue
). This flag will 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 | None = '')[source]¶
Sets
label
for this element If it’s empty it takes the relation id as labelAdded in version 3.16.
Deprecated since version 3.20: Label is handled directly in
QgsAttributeForm
.- Parameters:
label (Optional[str] = '')
- setMultiEditFeatureIds(self, fids: Any)[source]¶
Set multiple feature to edit simultaneously.
- Parameters:
fids (Any) – Multiple Id of features to edit
Added in version 3.24.
- setNmRelationId(self, nmRelationId: Any = None)[source]¶
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)
- setShowLabel(self, showLabel: bool)[source]¶
Defines if a title label should be shown for this widget. Only has an effect after
widget()
has been called at least once.Deprecated since version 3.20: Label is handled directly in
QgsAttributeForm
.- Parameters:
showLabel (bool)
- setShowLinkButton(self, showLinkButton: bool)[source]¶
Determines if the “link feature” button should be shown
Deprecated since version 3.16: Use
setVisibleButtons()
instead.- Parameters:
showLinkButton (bool)
- setShowSaveChildEditsButton(self, showChildEdits: bool)[source]¶
Determines if the “Save child layer edits” button should be shown
Added in version 3.14.
Deprecated since version 3.16: Use
setVisibleButtons()
instead.- Parameters:
showChildEdits (bool)
- setShowUnlinkButton(self, showUnlinkButton: bool)[source]¶
Determines if the “unlink feature” button should be shown
Deprecated since version 3.16: Use
setVisibleButtons()
instead.- Parameters:
showUnlinkButton (bool)
- setVisible(self, visible: bool)[source]¶
Sets the visibility of the wrapper’s widget.
- Parameters:
visible (bool) – set to
True
to show widget,False
to hide widget
- setVisibleButtons(self, buttons: QgsAttributeEditorRelation.Buttons | QgsAttributeEditorRelation.Button)[source]¶
Defines the buttons which are shown
Added in version 3.16.
Deprecated since version 3.18: Use
setWidgetConfig()
instead.- Parameters:
buttons (Union[QgsAttributeEditorRelation.Buttons, QgsAttributeEditorRelation.Button])
- setWidgetConfig(self, config: Dict[str, Any])[source]¶
Will set the config of this widget wrapper to the specified config.
- Parameters:
config (Dict[str, Any]) – The config for this wrapper
Added in version 3.18.
- showLabel(self) bool [source]¶
Defines if a title label should be shown for this widget. Only has an effect after
widget()
has been called at least once.Deprecated since version 3.20: Label is handled directly in
QgsAttributeForm
.- Return type:
bool
- showLinkButton(self) bool [source]¶
Determines if the “link feature” button should be shown
Deprecated since version 3.16: Use
visibleButtons()
instead.- Return type:
bool
- showSaveChildEditsButton(self) bool [source]¶
Determines if the “Save child layer edits” button should be shown
Added in version 3.14.
Deprecated since version 3.16: Use
visibleButtons()
instead.- Return type:
bool
- showUnlinkButton(self) bool [source]¶
Determines if the “unlink feature” button should be shown
Deprecated since version 3.16: Use
visibleButtons()
instead.- Return type:
bool
- visibleButtons(self) QgsAttributeEditorRelation.Buttons [source]¶
Returns the buttons which are shown
Added in version 3.16.
Deprecated since version 3.18: Use
widgetConfig()
instead.- Return type:
- widgetConfig(self) Dict[str, Any] [source]¶
Returns the whole widget config
Added in version 3.18.
- Return type:
Dict[str, Any]
- widgetValueChanged(self, attribute: str | None, newValue: Any, attributeChanged: bool)[source]¶
Will be called when a value in the current edited form or table row changes
Forward the signal to the embedded form
- Parameters:
attribute (Optional[str]) – The name of the attribute that changed.
newValue (Any) – The new value of the attribute.
attributeChanged (bool) – If
True
, it corresponds to an actual change of the feature attribute
Added in version 3.14.