QGIS API Documentation 3.99.0-Master (21b3aa880ba)
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
29
30
39class CORE_DEPRECATED_EXPORT QgsSettingsEntryGroup SIP_DEPRECATED
40{
41 public:
43 QgsSettingsEntryGroup( QList<const QgsSettingsEntryBase *> settings );
44#ifdef SIP_RUN
45 % MethodCode
46 sipCpp = new QgsSettingsEntryGroup( *a0, false );
47 sipIsErr = sipCpp->isValid() ? 0 : 1;
48 if ( sipIsErr )
49 PyErr_SetString( PyExc_ValueError, QStringLiteral( "Settings do not share the same base definition key for this group. This will lead to unpredictable results." ).toUtf8().constData() );
50 % End
51#endif
52
54 QgsSettingsEntryGroup( QList<const QgsSettingsEntryBase *> settings, bool fatalErrorIfInvalid ) SIP_SKIP;
55
57 bool isValid() const {return mIsValid;}
58
60 QString baseKey( const QStringList &dynamicKeyPartList = QStringList() ) const;
61
63 const QList<const QgsSettingsEntryBase *> settings() const {return mSettings;}
64
69 void removeAllSettingsAtBaseKey( const QStringList &dynamicKeyPartList = QStringList() ) const;
70
75 void removeAllChildrenSettings( const QString &dynamicKeyPart = QString() ) const;
76
81 void removeAllChildrenSettings( const QStringList &dynamicKeyPartList ) const;
82
83 private:
84 bool hasDynamicKey() const;
85
86 QList<const QgsSettingsEntryBase *> mSettings;
87 QString mDefinitionBaseKey;
88 bool mIsValid = true;
89};
90
91
92#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