QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
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. | |
QgsAbstractRelationEditorWidget * | create (const QString &widgetType, const QVariantMap &config, QWidget *parent=nullptr) const |
Create a relation widget of a given type for a given field. | |
QgsAbstractRelationEditorConfigWidget * | createConfigWidget (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. | |
Keeps track of the registered relations widgets.
New widgets can be registered, old ones deleted. The default {
Definition at line 31 of file qgsrelationwidgetregistry.h.
QgsRelationWidgetRegistry::QgsRelationWidgetRegistry | ( | ) |
Constructor.
Definition at line 21 of file qgsrelationwidgetregistry.cpp.
QgsRelationWidgetRegistry::~QgsRelationWidgetRegistry | ( | ) |
Definition at line 28 of file qgsrelationwidgetregistry.cpp.
void QgsRelationWidgetRegistry::addRelationWidget | ( | QgsAbstractRelationEditorWidgetFactory * | widgetFactory | ) |
Adds a new registered relation widgetFactory.
Definition at line 34 of file qgsrelationwidgetregistry.cpp.
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.
widgetType | The widget type to create a relation editor for |
config | The configuration of the widget |
parent |
Definition at line 77 of file qgsrelationwidgetregistry.cpp.
QgsAbstractRelationEditorConfigWidget * QgsRelationWidgetRegistry::createConfigWidget | ( | const QString & | widgetType, |
const QgsRelation & | relation, | ||
QWidget * | parent = nullptr |
||
) | const |
Creates a configuration widget.
widgetType | The widget type to create a configuration widget for |
relation | The relation for which this widget will be created |
parent | The parent widget for the created widget |
Definition at line 85 of file qgsrelationwidgetregistry.cpp.
QString QgsRelationWidgetRegistry::defaultWidgetType | ( | ) | const |
Returns the default editor widget type.
Definition at line 67 of file qgsrelationwidgetregistry.cpp.
QMap< QString, QgsAbstractRelationEditorWidgetFactory * > QgsRelationWidgetRegistry::factories | ( | ) | const |
Gets access to all registered factories.
Definition at line 72 of file qgsrelationwidgetregistry.cpp.
QStringList QgsRelationWidgetRegistry::relationWidgetNames | ( | ) | const |
Returns a list of names of registered relation widgets.
Definition at line 54 of file qgsrelationwidgetregistry.cpp.
void QgsRelationWidgetRegistry::removeRelationWidget | ( | const QString & | widgetType | ) |
Removes a registered relation widget with given widgetType.
Definition at line 45 of file qgsrelationwidgetregistry.cpp.
void QgsRelationWidgetRegistry::setDefaultWidgetType | ( | const QString & | widgetType | ) |
Sets the default editor widget type.
Does nothing if the provided widget type is not present.
widgetType | The widget type to be used by default. |
Definition at line 59 of file qgsrelationwidgetregistry.cpp.