QGIS API Documentation  3.27.0-Master (aef1b1ec20)
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 : [email protected]
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 
31 class GUI_EXPORT QgsRelationWidgetRegistry
32 {
33  public:
34 
39 
41 
45  void addRelationWidget( QgsAbstractRelationEditorWidgetFactory *widgetFactory SIP_TRANSFER );
46 
50  void removeRelationWidget( const QString &widgetType );
51 
55  QStringList relationWidgetNames() const;
56 
60  QMap<QString, QgsAbstractRelationEditorWidgetFactory *> factories() const;
61 
69  QgsAbstractRelationEditorWidget *create( const QString &widgetType, const QVariantMap &config, QWidget *parent = nullptr ) const SIP_TRANSFERBACK;
70 
78  QgsAbstractRelationEditorConfigWidget *createConfigWidget( const QString &widgetType, const QgsRelation &relation, QWidget *parent = nullptr ) const SIP_TRANSFERBACK;
79 
80 
86  void setDefaultWidgetType( const QString &widgetType );
87 
92  QString defaultWidgetType() const;
93 
94  private:
95 
96  QMap<QString, QgsAbstractRelationEditorWidgetFactory *> mRelationWidgetFactories;
97 
98  QString mDefaultWidgetType;
99 };
100 
101 #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.
#define SIP_TRANSFER
Definition: qgis_sip.h:36
#define SIP_TRANSFERBACK
Definition: qgis_sip.h:48