QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgssettingseditorwidgetregistry.h
Go to the documentation of this file.
1/***************************************************************************
2 qgssettingseditorwidgetregistry.h
3 ---------------------
4 begin : April 2023
5 copyright : (C) 2023 by Denis Rouzaud
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSSETTINGSEDITORREGISTRY_H
17#define QGSSETTINGSEDITORREGISTRY_H
18
19#include "qgis_gui.h"
20#include "qgis_sip.h"
21
22#include <QMap>
23#include <QObject>
24
25class QWidget;
28
36{
37 public:
41
47
53
55 QgsSettingsEditorWidgetWrapper *createWrapper( const QString &id, QObject *parent ) const SIP_FACTORY;
56
58 QWidget *createEditor( const QgsSettingsEntryBase *setting, const QStringList &dynamicKeyPartList, QWidget *parent = nullptr ) const SIP_TRANSFERBACK;
59
60 private:
61 QMap<QString, QgsSettingsEditorWidgetWrapper *> mWrappers;
62 QMap<const QgsSettingsEntryBase *, QgsSettingsEditorWidgetWrapper *> mSpecificWrappers;
63};
64
65#endif // QGSSETTINGSEDITORREGISTRY_H
void addWrapperForSetting(QgsSettingsEditorWidgetWrapper *wrapper, const QgsSettingsEntryBase *setting)
Adds an editor widget wrapper for a specific setting to the registry.
QWidget * createEditor(const QgsSettingsEntryBase *setting, const QStringList &dynamicKeyPartList, QWidget *parent=nullptr) const
Creates an editor widget for the given setting using the corresponding registered wrapper.
bool addWrapper(QgsSettingsEditorWidgetWrapper *wrapper)
Adds an editor widget wrapper to the registry If an editor widget with same id already exists,...
QgsSettingsEditorWidgetWrapper * createWrapper(const QString &id, QObject *parent) const
Returns a new instance of the editor widget for the given id.
Base class for settings editor wrappers.
Represents a settings entry and provides methods for reading and writing settings values.
#define SIP_KEEPREFERENCE
Definition qgis_sip.h:94
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_TRANSFERBACK
Definition qgis_sip.h:48
#define SIP_FACTORY
Definition qgis_sip.h:84