QGIS API Documentation  3.21.0-Master (5b68dc587e)
Public Member Functions | List of all members
QgsRelationWidgetRegistry Class Reference

Keeps track of the registered relations widgets. More...

#include <qgsrelationwidgetregistry.h>

Public Member Functions

 QgsRelationWidgetRegistry ()
 Constructor. More...
 
 ~QgsRelationWidgetRegistry ()
 
void addRelationWidget (QgsAbstractRelationEditorWidgetFactory *widgetFactory)
 Adds a new registered relation widgetFactory. More...
 
QgsAbstractRelationEditorWidgetcreate (const QString &widgetType, const QVariantMap &config, QWidget *parent=nullptr) const
 Create a relation widget of a given type for a given field. More...
 
QgsAbstractRelationEditorConfigWidgetcreateConfigWidget (const QString &widgetType, const QgsRelation &relation, QWidget *parent=nullptr) const
 Creates a configuration widget. More...
 
QString defaultWidgetType () const
 Returns the default editor widget type. More...
 
QMap< QString, QgsAbstractRelationEditorWidgetFactory * > factories () const
 Gets access to all registered factories. More...
 
QStringList relationWidgetNames ()
 Returns a list of names of registered relation widgets. More...
 
void removeRelationWidget (const QString &widgetType)
 Removes a registered relation widget with given widgetType. More...
 
void setDefaultWidgetType (const QString &widgetType)
 Sets the default editor widget type. More...
 

Detailed Description

Keeps track of the registered relations widgets.

New widgets can be registered, old ones deleted. The default {

See also
QgsRelationEditorWidget} is protected from removing.
Since
QGIS 3.18

Definition at line 33 of file qgsrelationwidgetregistry.h.

Constructor & Destructor Documentation

◆ QgsRelationWidgetRegistry()

QgsRelationWidgetRegistry::QgsRelationWidgetRegistry ( )

Constructor.

Definition at line 21 of file qgsrelationwidgetregistry.cpp.

◆ ~QgsRelationWidgetRegistry()

QgsRelationWidgetRegistry::~QgsRelationWidgetRegistry ( )

Definition at line 28 of file qgsrelationwidgetregistry.cpp.

Member Function Documentation

◆ addRelationWidget()

void QgsRelationWidgetRegistry::addRelationWidget ( QgsAbstractRelationEditorWidgetFactory widgetFactory)

Adds a new registered relation widgetFactory.

Definition at line 34 of file qgsrelationwidgetregistry.cpp.

◆ create()

QgsAbstractRelationEditorWidget * QgsRelationWidgetRegistry::create ( const QString &  widgetType,
const QVariantMap &  config,
QWidget *  parent = nullptr 
) const

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

Parameters
widgetTypeThe widget type to create a relation editor for
configThe configuration of the widget
parent

Definition at line 77 of file qgsrelationwidgetregistry.cpp.

◆ createConfigWidget()

QgsAbstractRelationEditorConfigWidget * QgsRelationWidgetRegistry::createConfigWidget ( const QString &  widgetType,
const QgsRelation relation,
QWidget *  parent = nullptr 
) const

Creates a configuration widget.

Parameters
widgetTypeThe widget type to create a configuration widget for
relationThe relation for which this widget will be created
parentThe parent widget for the created widget

Definition at line 85 of file qgsrelationwidgetregistry.cpp.

◆ defaultWidgetType()

QString QgsRelationWidgetRegistry::defaultWidgetType ( ) const

Returns the default editor widget type.

Since
QGIS 3.20

Definition at line 67 of file qgsrelationwidgetregistry.cpp.

◆ factories()

QMap< QString, QgsAbstractRelationEditorWidgetFactory * > QgsRelationWidgetRegistry::factories ( ) const

Gets access to all registered factories.

Definition at line 72 of file qgsrelationwidgetregistry.cpp.

◆ relationWidgetNames()

QStringList QgsRelationWidgetRegistry::relationWidgetNames ( )

Returns a list of names of registered relation widgets.

Definition at line 54 of file qgsrelationwidgetregistry.cpp.

◆ removeRelationWidget()

void QgsRelationWidgetRegistry::removeRelationWidget ( const QString &  widgetType)

Removes a registered relation widget with given widgetType.

Definition at line 45 of file qgsrelationwidgetregistry.cpp.

◆ setDefaultWidgetType()

void QgsRelationWidgetRegistry::setDefaultWidgetType ( const QString &  widgetType)

Sets the default editor widget type.

Does nothing if the provided widget type is not present.

Parameters
widgetTypeThe widget type to be used by default.
Since
QGIS 3.20

Definition at line 59 of file qgsrelationwidgetregistry.cpp.


The documentation for this class was generated from the following files: