QGIS API Documentation 3.41.0-Master (af5edcb665c)
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
22#include "qgis_gui.h"
23
32{
33 public:
38
40
44 void addRelationWidget( QgsAbstractRelationEditorWidgetFactory *widgetFactory SIP_TRANSFER );
45
49 void removeRelationWidget( const QString &widgetType );
50
54 QStringList relationWidgetNames() const;
55
59 QMap<QString, QgsAbstractRelationEditorWidgetFactory *> factories() const;
60
68 QgsAbstractRelationEditorWidget *create( const QString &widgetType, const QVariantMap &config, QWidget *parent = nullptr ) const SIP_TRANSFERBACK;
69
77 QgsAbstractRelationEditorConfigWidget *createConfigWidget( const QString &widgetType, const QgsRelation &relation, QWidget *parent = nullptr ) const SIP_TRANSFERBACK;
78
79
85 void setDefaultWidgetType( const QString &widgetType );
86
91 QString defaultWidgetType() const;
92
93 private:
94 QMap<QString, QgsAbstractRelationEditorWidgetFactory *> mRelationWidgetFactories;
95
96 QString mDefaultWidgetType;
97};
98
99#endif // QGSRELATIONWIDGETREGISTRY_H
This class should be subclassed for every configurable relation widget type.
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