Class: QgsRelationWidgetRegistry¶
Keeps track of the registered relations widgets. New widgets can be
registered, old ones deleted. The default
{QgsRelationEditorWidget
} is protected from removing.
Added in version 3.18.
Methods
Adds a new registered relation widgetFactory |
|
Create a relation widget of a given type for a given field. |
|
Creates a configuration widget |
|
Returns the default editor widget type. |
|
Gets access to all registered factories |
|
Returns a list of names of registered relation widgets |
|
Removes a registered relation widget with given widgetType |
|
Sets the default editor widget type. |
- class qgis.gui.QgsRelationWidgetRegistry[source]¶
Bases:
object
- __init__()
Constructor
- __init__(a0: QgsRelationWidgetRegistry)
- Parameters:
- addRelationWidget(self, widgetFactory: QgsAbstractRelationEditorWidgetFactory | None)[source]¶
Adds a new registered relation
widgetFactory
- Parameters:
widgetFactory (Optional[QgsAbstractRelationEditorWidgetFactory])
- create(self, widgetType: str | None, config: Dict[str, Any], parent: QWidget | None = None) QgsAbstractRelationEditorWidget | None [source]¶
Create a relation widget of a given type for a given field.
- Parameters:
widgetType (Optional[str]) – The widget type to create a relation editor for
config (Dict[str, Any]) – The configuration of the widget
parent (Optional[QWidget] = None)
- Return type:
Optional[QgsAbstractRelationEditorWidget]
- createConfigWidget(self, widgetType: str | None, relation: QgsRelation, parent: QWidget | None = None) QgsAbstractRelationEditorConfigWidget | None [source]¶
Creates a configuration widget
- Parameters:
widgetType (Optional[str]) – The widget type to create a configuration widget for
relation (QgsRelation) – The relation for which this widget will be created
parent (Optional[QWidget] = None) – The parent widget for the created widget
- Return type:
Optional[QgsAbstractRelationEditorConfigWidget]
- defaultWidgetType(self) str [source]¶
Returns the default editor widget type.
Added in version 3.20.
- Return type:
str
- factories(self) Any ¶
Gets access to all registered factories
- Return type:
Any
- relationWidgetNames(self) List[str] [source]¶
Returns a list of names of registered relation widgets
- Return type:
List[str]