QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
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.
 
 ~QgsRelationWidgetRegistry ()
 
void addRelationWidget (QgsAbstractRelationEditorWidgetFactory *widgetFactory)
 Adds a new registered relation widgetFactory.
 
QgsAbstractRelationEditorWidgetcreate (const QString &widgetType, const QVariantMap &config, QWidget *parent=nullptr) const
 Create a relation widget of a given type for a given field.
 
QgsAbstractRelationEditorConfigWidgetcreateConfigWidget (const QString &widgetType, const QgsRelation &relation, QWidget *parent=nullptr) const
 Creates a configuration widget.
 
QString defaultWidgetType () const
 Returns the default editor widget type.
 
QMap< QString, QgsAbstractRelationEditorWidgetFactory * > factories () const
 Gets access to all registered factories.
 
QStringList relationWidgetNames () const
 Returns a list of names of registered relation widgets.
 
void removeRelationWidget (const QString &widgetType)
 Removes a registered relation widget with given widgetType.
 
void setDefaultWidgetType (const QString &widgetType)
 Sets the default editor widget type.
 

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 31 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 ( ) const

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: