QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgsrelationwidgetregistry.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsrelationwidgetregistry.h
3 ----------------------
4 begin : October 2020
5 copyright : (C) 2020 by Ivan Ivanov
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSRELATIONWIDGETREGISTRY_H
19#define QGSRELATIONWIDGETREGISTRY_H
20
21#include "qgis_gui.h"
23
35{
36 public:
41
43
48
52 void removeRelationWidget( const QString &widgetType );
53
57 QStringList relationWidgetNames() const;
58
62 QMap<QString, QgsAbstractRelationEditorWidgetFactory *> factories() const;
63
71 QgsAbstractRelationEditorWidget *create( const QString &widgetType, const QVariantMap &config, QWidget *parent = nullptr ) const SIP_TRANSFERBACK;
72
80 QgsAbstractRelationEditorConfigWidget *createConfigWidget( const QString &widgetType, const QgsRelation &relation, QWidget *parent = nullptr ) const SIP_TRANSFERBACK;
81
82
88 void setDefaultWidgetType( const QString &widgetType );
89
94 QString defaultWidgetType() const;
95
96 private:
97 QMap<QString, QgsAbstractRelationEditorWidgetFactory *> mRelationWidgetFactories;
98
99 QString mDefaultWidgetType;
100};
101
102#endif // QGSRELATIONWIDGETREGISTRY_H
Abstract base class for configurable relation widget types.
Factory class for creating relation widgets and their corresponding config widgets.
Base class to build new relation widgets.
void setDefaultWidgetType(const QString &widgetType)
Sets the default editor widget type.
QMap< QString, QgsAbstractRelationEditorWidgetFactory * > factories() const
Gets access to all registered factories.
void addRelationWidget(QgsAbstractRelationEditorWidgetFactory *widgetFactory)
Adds a new registered relation widgetFactory.
QStringList relationWidgetNames() const
Returns a list of names of registered relation widgets.
QgsAbstractRelationEditorConfigWidget * createConfigWidget(const QString &widgetType, const QgsRelation &relation, QWidget *parent=nullptr) const
Creates a configuration widget.
void removeRelationWidget(const QString &widgetType)
Removes a registered relation widget with given widgetType.
QgsAbstractRelationEditorWidget * create(const QString &widgetType, const QVariantMap &config, QWidget *parent=nullptr) const
Create a relation widget of a given type for a given field.
QString defaultWidgetType() const
Returns the default editor widget type.
Represents a relationship between two vector layers.
Definition qgsrelation.h:42
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_TRANSFERBACK
Definition qgis_sip.h:48