Class: QgsRelationReferenceWidget¶
Class Hierarchy¶
Base classes¶
Methods
Determines if a button for adding new features should be shown. |
|
determines if the widget offers the possibility to select the related feature on the map (using a dedicated map tool) |
|
Determines if the filters are chained |
|
unset the currently related feature |
|
determines if the form of the related feature will be shown |
|
Returns the limit of fetched features (0 means all features) |
|
Returns the currently set filter expression. |
|
returns the related feature foreign key |
|
Returns the related feature foreign keys |
|
activate the map tool to select a new related feature on the map |
|
open the form of the related feature in a new dialog |
|
determines the open form button is visible in the widget |
|
determines if the drop-down is enabled |
|
Returns the related feature (from the referenced layer) if no feature is related, it returns an invalid feature |
|
Returns the public data source of the referenced layer |
|
Returns the id of the referenced layer |
|
Returns the name of the referenced layer |
|
Returns the data provider key of the referenced layer |
|
Returns the current relation, which might be invalid |
|
Trigger save of the embedded referenced attribute form. |
|
Determines if a button for adding new features should be shown. |
|
Set if filters are chained. |
|
Sets the editor context |
|
Set the limit of fetched features (0 means all features) |
|
If not empty, will be used as filter expression. |
|
Sets the fields for which filter comboboxes will be created |
|
this sets the related feature using from the foreign key |
|
Sets the related feature using the foreign keys |
|
Set the current form feature (from the referencing layer) |
|
Set the current parent form feature |
|
Set the public data source of the referenced layer to referencedLayerDataSource |
|
Set the id of the referenced layer to referencedLayerId |
|
Set the name of the referenced layer to referencedLayerName |
|
Set the data provider key of the referenced layer to referencedLayerProviderKey |
|
Sets the widget to display in an indeterminate "mixed value" state. |
Signals
Emitted when the foreign key changed |
|
Emitted when the foreign keys changed |
Attributes
- class qgis.gui.QgsRelationReferenceWidget(parent: QWidget | None)[source]¶
Bases:
QWidget
- class CanvasExtent¶
Bases:
int
- Fixed = 0¶
- Pan = 1¶
- Scale = 2¶
- allowAddFeatures(self) bool [source]¶
Determines if a button for adding new features should be shown.
- Return type:
bool
- allowMapIdentification(self) bool [source]¶
determines if the widget offers the possibility to select the related feature on the map (using a dedicated map tool)
- Return type:
bool
- chainFilters(self) bool [source]¶
Determines if the filters are chained
- Return type:
bool
- Returns:
True
if filters are chained
- embedForm(self) bool [source]¶
determines if the form of the related feature will be shown
- Return type:
bool
- fetchLimit(self) int [source]¶
Returns the limit of fetched features (0 means all features)
Added in version 3.32.
- Return type:
int
- foreignKey(self) Any [source]¶
returns the related feature foreign key
Deprecated since version 3.10.
- Return type:
Any
- signal foreignKeyChanged[source]¶
Emitted when the foreign key changed
Deprecated since version 3.10.
- foreignKeys(self) List[Any] [source]¶
Returns the related feature foreign keys
Added in version 3.10.
- Return type:
List[Any]
- signal foreignKeysChanged(keys: List[object])[source]¶
Emitted when the foreign keys changed
Added in version 3.10.
- Parameters:
keys (List[object])
- openFormButtonVisible(self) bool [source]¶
determines the open form button is visible in the widget
- Return type:
bool
- referencedFeature(self) QgsFeature [source]¶
Returns the related feature (from the referenced layer) if no feature is related, it returns an invalid feature
- Return type:
- referencedLayerDataSource(self) str [source]¶
Returns the public data source of the referenced layer
Added in version 3.12.
- Return type:
str
- referencedLayerId(self) str [source]¶
Returns the id of the referenced layer
Added in version 3.12.
- Return type:
str
- referencedLayerName(self) str [source]¶
Returns the name of the referenced layer
Added in version 3.12.
- Return type:
str
- referencedLayerProviderKey(self) str [source]¶
Returns the data provider key of the referenced layer
Added in version 3.12.
- Return type:
str
- relation(self) QgsRelation [source]¶
Returns the current relation, which might be invalid
Added in version 3.10.
- Return type:
- saveReferencedAttributeForm(self) bool [source]¶
Trigger save of the embedded referenced attribute form. Returns
True
on success or if no embedded form is present.Added in version 3.40.
- Return type:
bool
- setAllowAddFeatures(self, allowAddFeatures: bool)[source]¶
Determines if a button for adding new features should be shown.
- Parameters:
allowAddFeatures (bool)
- setAllowMapIdentification(self, allowMapIdentification: bool)[source]¶
- Parameters:
allowMapIdentification (bool)
- setChainFilters(self, chainFilters: bool)[source]¶
Set if filters are chained. Chained filters restrict the option of subsequent filters based on the selection of a previous filter.
- Parameters:
chainFilters (bool) – If chaining should be enabled
- setEditorContext(self, context: QgsAttributeEditorContext, canvas: QgsMapCanvas | None, messageBar: QgsMessageBar | None)[source]¶
Sets the editor
context
Note
if context cadDockWidget is null, it won’t be possible to digitize the geometry of a referenced feature from this widget
- Parameters:
context (QgsAttributeEditorContext)
canvas (Optional[QgsMapCanvas])
messageBar (Optional[QgsMessageBar])
- setFetchLimit(self, fetchLimit: int)[source]¶
Set the limit of fetched features (0 means all features)
Added in version 3.32.
- Parameters:
fetchLimit (int)
- setFilterExpression(self, filterExpression: str | None)[source]¶
If not empty, will be used as filter expression. Only if this evaluates to
True
, the value will be shown.- Parameters:
filterExpression (Optional[str])
- setFilterFields(self, filterFields: Iterable[str | None])[source]¶
Sets the fields for which filter comboboxes will be created
- Parameters:
filterFields (Iterable[Optional[str]])
- setForeignKey(self, value: Any)[source]¶
this sets the related feature using from the foreign key
Deprecated since version 3.10: Use setForeignKeys.
- Parameters:
value (Any)
- setForeignKeys(self, values: Iterable[Any])[source]¶
Sets the related feature using the foreign keys
Added in version 3.10.
- Parameters:
values (Iterable[Any])
- setFormFeature(self, formFeature: QgsFeature)[source]¶
Set the current form feature (from the referencing layer)
Added in version 3.10.
- Parameters:
formFeature (QgsFeature)
- setOpenFormButtonVisible(self, openFormButtonVisible: bool)[source]¶
- Parameters:
openFormButtonVisible (bool)
- setParentFormFeature(self, parentFormFeature: QgsFeature)[source]¶
Set the current parent form feature
Added in version 3.42.2.
- Parameters:
parentFormFeature (QgsFeature)
- setReferencedLayerDataSource(self, referencedLayerDataSource: str | None)[source]¶
Set the public data source of the referenced layer to
referencedLayerDataSource
Added in version 3.12.
- Parameters:
referencedLayerDataSource (Optional[str])
- setReferencedLayerId(self, referencedLayerId: str | None)[source]¶
Set the id of the referenced layer to
referencedLayerId
Added in version 3.12.
- Parameters:
referencedLayerId (Optional[str])
- setReferencedLayerName(self, referencedLayerName: str | None)[source]¶
Set the name of the referenced layer to
referencedLayerName
Added in version 3.12.
- Parameters:
referencedLayerName (Optional[str])
- setReferencedLayerProviderKey(self, referencedLayerProviderKey: str | None)[source]¶
Set the data provider key of the referenced layer to
referencedLayerProviderKey
Added in version 3.12.
- Parameters:
referencedLayerProviderKey (Optional[str])
- setRelation(self, relation: QgsRelation, allowNullValue: bool)[source]¶
- Parameters:
relation (QgsRelation)
allowNullValue (bool)