QGIS API Documentation 3.99.0-Master (e9821da5c6b)
Loading...
Searching...
No Matches
qgssettingsentrygroup.h
Go to the documentation of this file.
1/***************************************************************************
2 qgssettingsentrygroup.h
3 --------------------------------------
4 Date : February 2021
5 Copyright : (C) 2021 by Damiano Lombardi
6 Email : damiano at opengis dot ch
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 QGSSETTINGSENTRYGROUP_H
17#define QGSSETTINGSENTRYGROUP_H
18
19#include <limits>
20
21#include "qgis.h"
22#include "qgis_core.h"
23#include "qgis_sip.h"
24
25#include <QColor>
26#include <QString>
27
28using namespace Qt::StringLiterals;
29
31
32
41class CORE_DEPRECATED_EXPORT QgsSettingsEntryGroup SIP_DEPRECATED
42{
43 public:
45 QgsSettingsEntryGroup( QList<const QgsSettingsEntryBase *> settings );
46#ifdef SIP_RUN
47 % MethodCode
48 sipCpp = new QgsSettingsEntryGroup( *a0, false );
49 sipIsErr = sipCpp->isValid() ? 0 : 1;
50 if ( sipIsErr )
51 PyErr_SetString( PyExc_ValueError, u"Settings do not share the same base definition key for this group. This will lead to unpredictable results."_s.toUtf8().constData() );
52 % End
53#endif
54
56 QgsSettingsEntryGroup( QList<const QgsSettingsEntryBase *> settings, bool fatalErrorIfInvalid ) SIP_SKIP;
57
59 bool isValid() const {return mIsValid;}
60
62 QString baseKey( const QStringList &dynamicKeyPartList = QStringList() ) const;
63
65 const QList<const QgsSettingsEntryBase *> settings() const {return mSettings;}
66
71 void removeAllSettingsAtBaseKey( const QStringList &dynamicKeyPartList = QStringList() ) const;
72
77 void removeAllChildrenSettings( const QString &dynamicKeyPart = QString() ) const;
78
83 void removeAllChildrenSettings( const QStringList &dynamicKeyPartList ) const;
84
85 private:
86 bool hasDynamicKey() const;
87
88 QList<const QgsSettingsEntryBase *> mSettings;
89 QString mDefinitionBaseKey;
90 bool mIsValid = true;
91};
92
93
94#endif // QGSSETTINGSENTRYGROUP_H
Represents a settings entry and provides methods for reading and writing settings values.
bool isValid() const
Returns if the group is valid (if settings share the same base key).
const QList< const QgsSettingsEntryBase * > settings() const
Returns all the settings.
QgsSettingsEntryGroup(QList< const QgsSettingsEntryBase * > settings)
Constructor.
#define SIP_DEPRECATED
Definition qgis_sip.h:114
#define SIP_SKIP
Definition qgis_sip.h:134