QGIS API Documentation 3.30.0-'s-Hertogenbosch (f186b8efe0)
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 <QString>
20#include <QColor>
21#include <limits>
22
23#include "qgis.h"
24#include "qgis_core.h"
25#include "qgis_sip.h"
26
28
29
38class CORE_DEPRECATED_EXPORT QgsSettingsEntryGroup SIP_DEPRECATED
39{
40 public:
42 QgsSettingsEntryGroup( QList<const QgsSettingsEntryBase *> settings )
43 : QgsSettingsEntryGroup( settings, true )
44 {}
45#ifdef SIP_RUN
46 % MethodCode
47 sipCpp = new QgsSettingsEntryGroup( *a0, false );
48 sipIsErr = sipCpp->isValid() ? 0 : 1;
49 if ( sipIsErr )
50 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() );
51 % End
52#endif
53
55 QgsSettingsEntryGroup( QList<const QgsSettingsEntryBase *> settings, bool fatalErrorIfInvalid ) SIP_SKIP;
56
58 bool isValid() const {return mIsValid;}
59
61 QString baseKey( const QStringList &dynamicKeyPartList = QStringList() ) const;
62
64 const QList<const QgsSettingsEntryBase *> settings() const {return mSettings;}
65
70 void removeAllSettingsAtBaseKey( const QStringList &dynamicKeyPartList = QStringList() ) const;
71
76 void removeAllChildrenSettings( const QString &dynamicKeyPart = QString() ) const;
77
82 void removeAllChildrenSettings( const QStringList &dynamicKeyPartList ) const;
83
84 private:
85 bool hasDynamicKey() const;
86
87 QList<const QgsSettingsEntryBase *> mSettings;
88 QString mDefinitionBaseKey;
89 bool mIsValid = true;
90};
91
92
93#endif // QGSSETTINGSENTRYGROUP_H
Represent settings entry and provides methods for reading and writing settings values.
Creates a group of setting which have a common definition of base key.
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:106
#define SIP_SKIP
Definition: qgis_sip.h:126