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