QGIS API Documentation 3.43.0-Master (b60ef06885e)
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
6 email : ivan@opengis.ch
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
22#include "qgis_gui.h"
23
35{
36 public:
41
43
47 void addRelationWidget( QgsAbstractRelationEditorWidgetFactory *widgetFactory SIP_TRANSFER );
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.
Keeps track of the registered relations widgets.
Represents a relationship between two vector layers.
Definition qgsrelation.h:44
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_TRANSFERBACK
Definition qgis_sip.h:48