QGIS API Documentation 3.41.0-Master (af5edcb665c)
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 <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#ifdef SIP_RUN
44 % MethodCode
45 sipCpp = new QgsSettingsEntryGroup( *a0, false );
46 sipIsErr = sipCpp->isValid() ? 0 : 1;
47 if ( sipIsErr )
48 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() );
49 % End
50#endif
51
53 QgsSettingsEntryGroup( QList<const QgsSettingsEntryBase *> settings, bool fatalErrorIfInvalid ) SIP_SKIP;
54
56 bool isValid() const {return mIsValid;}
57
59 QString baseKey( const QStringList &dynamicKeyPartList = QStringList() ) const;
60
62 const QList<const QgsSettingsEntryBase *> settings() const {return mSettings;}
63
68 void removeAllSettingsAtBaseKey( const QStringList &dynamicKeyPartList = QStringList() ) const;
69
74 void removeAllChildrenSettings( const QString &dynamicKeyPart = QString() ) const;
75
80 void removeAllChildrenSettings( const QStringList &dynamicKeyPartList ) const;
81
82 private:
83 bool hasDynamicKey() const;
84
85 QList<const QgsSettingsEntryBase *> mSettings;
86 QString mDefinitionBaseKey;
87 bool mIsValid = true;
88};
89
90
91#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.
#define SIP_DEPRECATED
Definition qgis_sip.h:106
#define SIP_SKIP
Definition qgis_sip.h:126