Class: QgsRelationWidgetRegistry

class qgis.gui.QgsRelationWidgetRegistry

Bases: sip.wrapper

Constructor

QgsRelationWidgetRegistry(QgsRelationWidgetRegistry)

Keeps track of the registered relations widgets. New widgets can be registered, old ones deleted. The default {QgsRelationEditorWidget} is protected from removing.

Methods

addRelationWidget

Adds a new registered relation widgetFactory

create

Create a relation widget of a given type for a given field.

createConfigWidget

Creates a configuration widget

factories

Gets access to all registered factories

relationWidgetNames

Returns a list of names of registered relation widgets

removeRelationWidget

Removes a registered relation widget with given widgetType

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

QgsAbstractRelationEditorWidget

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

QgsAbstractRelationEditorConfigWidget

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) –