Class: QgsRelationWidgetWrapper¶
- class qgis.gui.QgsRelationWidgetWrapper(vl: QgsVectorLayer, relation: QgsRelation, editor: QWidget = None, parent: QWidget = None)¶
Bases:
QgsWidgetWrapper
Constructor for QgsRelationWidgetWrapper
QgsRelationWidgetWrapper(relationEditorName: str, vl:
QgsVectorLayer
, relation:QgsRelation
, editor: QWidget = None, parent: QWidget = None) Constructor for QgsRelationWidgetWrapperMethods
- param parent:
Determines the force suppress form popup status that is configured for this widget
- param editor:
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.
- param feature:
Sets force suppress form popup status to
forceSuppressFormPopup
for this widget and for the vectorLayerTools (ifTrue
).Sets
label
for this element If it's empty it takes the relation id as labelSet 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
- rtype:
bool
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
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- createWidget(self, parent: QWidget) QWidget ¶
- Parameters:
parent (QWidget) –
- Return type:
QWidget
- customEvent(self, QEvent)¶
- disconnectNotify(self, QMetaMethod)¶
- forceSuppressFormPopup(self) bool ¶
Determines the force suppress form popup status that is configured for this widget
New in version 3.16.
- Return type:
bool
- initWidget(self, editor: QWidget)¶
- Parameters:
editor (QWidget) –
- isSignalConnected(self, QMetaMethod) bool ¶
- label(self) str ¶
Determines the label of this element
New in version 3.16.
Deprecated since version QGIS: 3.20 label is handled directly in
QgsAttributeForm
.- 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
- receivers(self, PYQT_SIGNAL) int ¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- relation(self) QgsRelation ¶
The relation for which this wrapper is created.
New in version 3.0.
- Return type:
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setFeature(self, feature: QgsFeature)¶
- Parameters:
feature (QgsFeature) –
- setForceSuppressFormPopup(self, forceSuppressFormPopup: bool)¶
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.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 labelNew in version 3.16.
Deprecated since version QGIS: 3.20 label is handled directly in
QgsAttributeForm
.- Parameters:
label (str = '') –
- setMultiEditFeatureIds(self, fids: object)¶
Set multiple feature to edit simultaneously.
- Parameters:
fids (object) – Multiple Id of features to edit
New in version 3.24.
- 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) –
- setShowLabel(self, showLabel: bool)¶
Defines if a title label should be shown for this widget. Only has an effect after
widget()
has been called at least once.New in version 2.18.
Deprecated since version QGIS: 3.20 label is handled directly in
QgsAttributeForm
.- Parameters:
showLabel (bool) –
- 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) –
- setVisible(self, visible: bool)¶
Sets the visibility of the wrapper’s widget.
- Parameters:
visible (bool) – set to
True
to show widget,False
to hide widget
New in version 2.16.
- setVisibleButtons(self, buttons: QgsAttributeEditorRelation.Buttons | QgsAttributeEditorRelation.Button)¶
Defines the buttons which are shown
New in version 3.16.
Deprecated since version QGIS: 3.18 use
setWidgetConfig()
instead- Parameters:
buttons (Union[QgsAttributeEditorRelation.Buttons) –
- setWidgetConfig(self, config: Dict[str, Any])¶
Will set the config of this widget wrapper to the specified config.
- Parameters:
config (Dict[str) – The config for this wrapper
New in version 3.18.
- showLabel(self) bool ¶
Defines if a title label should be shown for this widget. Only has an effect after
widget()
has been called at least once.New in version 2.18.
Deprecated since version QGIS: 3.20 label is handled directly in
QgsAttributeForm
.- Return type:
bool
- 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
- timerEvent(self, QTimerEvent)¶
- valid(self) bool ¶
- Return type:
bool
- visibleButtons(self) QgsAttributeEditorRelation.Buttons ¶
Returns the buttons which are shown
New in version 3.16.
Deprecated since version QGIS: 3.18 use
widgetConfig()
instead- Return type:
- widgetConfig(self) Dict[str, Any] ¶
Returns the whole widget config
New in version 3.18.
- Return type:
Dict[str, Any]
- widgetValueChanged(self, attribute: str, newValue: Any, attributeChanged: bool)¶
Will be called when a value in the current edited form or table row changes
Forward the signal to the embedded form
- Parameters:
attribute (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
New in version 3.14.