Skip to content

Commit 0529d60

Browse files
committedJan 17, 2023
fix leftover and missging SIP_THROW and better dox
1 parent dd99bb0 commit 0529d60

File tree

6 files changed

+147
-113
lines changed

6 files changed

+147
-113
lines changed
 

‎python/core/auto_generated/settings/qgssettings.sip.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static bool setGlobalSettingsPath( QString path );
6666
};
6767

6868

69-
static QgsSettingsTreeElement *createPluginTreeElement( const QString &pluginName ) throw( QgsSettingsException );
69+
static QgsSettingsTreeElement *createPluginTreeElement( const QString &pluginName );
7070
%Docstring
7171
Creates a settings tree element for the given ``pluginName``
7272

‎python/core/auto_generated/settings/qgssettingsentry.sip.in

Lines changed: 59 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -64,26 +64,28 @@ Transforms a dynamic key part string to list
6464
%Docstring
6565
Constructor for QgsSettingsEntryBase.
6666

67-
The ``key`` argument specifies the key of the settings.
68-
The ``section`` argument specifies the section.
69-
The ``defaultValue`` argument specifies the default value for the settings entry.
70-
The ``description`` argument specifies a description for the settings entry.
71-
The ``options`` argument specifies the options for the settings entry.
67+
\arg key specifies the key of the settings.
68+
\arg section specifies the section.
69+
\arg defaultValue specifies the default value for the settings entry.
70+
\arg description specifies a description for the settings entry.
71+
\arg options specifies the options for the settings entry.
7272
%End
7373

7474
QgsSettingsEntryBase( const QString &key,
7575
QgsSettingsTreeElement *parentTreeElement,
7676
const QVariant &defaultValue = QVariant(),
7777
const QString &description = QString(),
78-
Qgis::SettingsOptions options = Qgis::SettingsOptions() );
78+
Qgis::SettingsOptions options = Qgis::SettingsOptions() ) throw( QgsSettingsException );
7979
%Docstring
8080
Constructor for QgsSettingsEntryBase.
8181

82-
The ``key`` argument specifies the key of the settings.
83-
The ``parent`` argument specifies the parent in the tree of settings.
84-
The ``defaultValue`` argument specifies the default value for the settings entry.
85-
The ``description`` argument specifies a description for the settings entry.
86-
The ``options`` argument specifies the options for the settings entry.
82+
\arg key specifies the key of the settings.
83+
\arg parent specifies the parent in the tree of settings.
84+
\arg defaultValue specifies the default value for the settings entry.
85+
\arg description specifies a description for the settings entry.
86+
\arg options specifies the options for the settings entry.
87+
88+
:raises QgsSettingsException: if the number of given parent named items doesn't match the complete key definition
8789
%End
8890

8991
virtual ~QgsSettingsEntryBase();
@@ -92,14 +94,14 @@ The ``options`` argument specifies the options for the settings entry.
9294
%Docstring
9395
Returns settings entry key.
9496

95-
The ``dynamicKeyPart`` argument specifies the dynamic part of the settings key.
97+
\arg dynamicKeyPart specifies the dynamic part of the settings key.
9698
%End
9799

98100
QString key( const QStringList &dynamicKeyPartList ) const;
99101
%Docstring
100102
Returns settings entry key.
101103

102-
The ``dynamicKeyParts`` argument specifies the list of dynamic parts of the settings key.
104+
\arg dynamicKeyParts specifies the list of dynamic parts of the settings key.
103105
%End
104106

105107
bool keyIsValid( const QString &key ) const;
@@ -110,7 +112,7 @@ This is useful for settings with dynamic keys. For example this permits one to c
110112
the settings key "NewsFeed/httpsfeedqgisorg/27/content" is valid for the settings entry
111113
defined with the key "NewsFeed/%1/%2/content"
112114

113-
The ``key`` to check
115+
\arg key to check
114116
%End
115117

116118
QString definitionKey() const;
@@ -136,14 +138,14 @@ Returns the settings options
136138
%Docstring
137139
Returns ``True`` if the settings is contained in the underlying QSettings.
138140

139-
The ``dynamicKeyPart`` argument specifies the dynamic part of the settings key.
141+
\arg dynamicKeyPart specifies the dynamic part of the settings key.
140142
%End
141143

142144
bool exists( const QStringList &dynamicKeyPartList ) const;
143145
%Docstring
144146
Returns ``True`` if the settings is contained in the underlying QSettings.
145147

146-
The ``dynamicKeyParts`` argument specifies the list of dynamic parts of the settings key.
148+
\arg dynamicKeyParts specifies the list of dynamic parts of the settings key.
147149
%End
148150

149151
Qgis::SettingsOrigin origin( const QStringList &dynamicKeyPartList ) const;
@@ -161,14 +163,14 @@ Returns the origin of the setting if it exists
161163
%Docstring
162164
Removes the settings from the underlying QSettings.
163165

164-
The ``dynamicKeyPart`` argument specifies the dynamic part of the settings key.
166+
\arg dynamicKeyPart specifies the dynamic part of the settings key.
165167
%End
166168

167169
void remove( const QStringList &dynamicKeyPartList ) const;
168170
%Docstring
169171
Removes the settings from the underlying QSettings.
170172

171-
The ``dynamicKeyParts`` argument specifies the list of dynamic parts of the settings key.
173+
\arg dynamicKeyParts specifies the list of dynamic parts of the settings key.
172174
%End
173175

174176
QgsSettings::Section section() const;
@@ -184,7 +186,7 @@ Returns settings section. The settings section of the parent group is returned i
184186
Set settings value.
185187

186188
The ``value`` to set.
187-
The ``dynamicKeyPart`` argument specifies the dynamic part of the settings key.
189+
\arg dynamicKeyPart specifies the dynamic part of the settings key.
188190

189191
.. deprecated:: QGIS 3.26
190192
use setVariantValuePrivate or an implementation setValue instead
@@ -195,20 +197,20 @@ The ``dynamicKeyPart`` argument specifies the dynamic part of the settings key.
195197
Set settings value.
196198

197199
The ``value`` to set.
198-
The ``dynamicKeyParts`` argument specifies the list of dynamic parts of the settings key.
200+
\arg dynamicKeyParts specifies the list of dynamic parts of the settings key.
199201

200202
.. deprecated:: QGIS 3.26
201203
use setVariantValuePrivate or an implementation setValue instead
202204
%End
203205

204206
QVariant valueAsVariant( const QString &dynamicKeyPart = QString() ) const;
205207
%Docstring
206-
Returns settings value with the ``dynamicKeyPart`` argument specifying the dynamic part of the settings key.
208+
Returns settings value with \arg dynamicKeyPart specifying the dynamic part of the settings key.
207209
%End
208210

209211
QVariant valueAsVariant( const QStringList &dynamicKeyPartList ) const;
210212
%Docstring
211-
Returns settings value with the ``dynamicKeyPart`` argument specifying the dynamic part of the settings key.
213+
Returns settings value with \arg dynamicKeyPart specifying the dynamic part of the settings key.
212214
%End
213215

214216
QVariant valueAsVariantWithDefaultOverride( const QVariant &defaultValueOverride, const QString &dynamicKeyPart = QString() ) const;
@@ -222,8 +224,8 @@ Returns settings value with a ``defaultValueOverride``
222224
%Docstring
223225
Returns settings value.
224226

225-
The ``dynamicKeyPartList`` argument specifies the list of dynamic parts of the settings key.
226-
The ``defaultValueOverride`` argument if valid is used instead of the normal default value.
227+
\arg dynamicKeyPartList specifies the list of dynamic parts of the settings key.
228+
\arg defaultValueOverride if valid is used instead of the normal default value.
227229

228230
.. versionadded:: 3.26
229231
%End
@@ -358,11 +360,13 @@ Base abstract class for settings entry which are passed by reference
358360
%Docstring
359361
Constructor for QgsSettingsEntryByReference.
360362

361-
The ``key`` argument specifies the key of the settings.
362-
The ``parent`` argument specifies the parent in the tree of settings.
363-
The ``defaultValue`` argument specifies the default value for the settings entry.
364-
The ``description`` argument specifies a description for the settings entry.
365-
The ``options`` arguments specifies the options for the settings entry.
363+
\arg key specifies the key of the settings.
364+
\arg parent specifies the parent in the tree of settings.
365+
\arg defaultValue specifies the default value for the settings entry.
366+
\arg description specifies a description for the settings entry.
367+
\arg optionss specifies the options for the settings entry.
368+
369+
:raises QgsSettingsException: if the number of given parent named items doesn't match the complete key definition
366370
%End
367371

368372
QgsSettingsEntryByReference( const QString &key,
@@ -373,11 +377,11 @@ The ``options`` arguments specifies the options for the settings entry.
373377
%Docstring
374378
Constructor for QgsSettingsEntryByReference.
375379

376-
The ``key`` argument specifies the key of the settings.
377-
The ``section`` argument specifies the section.
378-
The ``defaultValue`` argument specifies the default value for the settings entry.
379-
The ``description`` argument specifies a description for the settings entry.
380-
The ``options`` arguments specifies the options for the settings entry.
380+
\arg key specifies the key of the settings.
381+
\arg section specifies the section.
382+
\arg defaultValue specifies the default value for the settings entry.
383+
\arg description specifies a description for the settings entry.
384+
\arg optionss specifies the options for the settings entry.
381385
%End
382386

383387

@@ -429,15 +433,15 @@ Returns the settings value for the ``dynamicKeyPartList`` and with a ``defaultV
429433
Set settings value.
430434

431435
The ``value`` to set.
432-
The ``dynamicKeyPart`` argument specifies the dynamic part of the settings key.
436+
\arg dynamicKeyPart specifies the dynamic part of the settings key.
433437
%End
434438

435439
bool setValue( const T &value, const QStringList &dynamicKeyPartList ) const;
436440
%Docstring
437441
Set settings value.
438442

439443
The ``value`` to set.
440-
The ``dynamicKeyParts`` argument specifies the list of dynamic parts of the settings key.
444+
\arg dynamicKeyParts specifies the list of dynamic parts of the settings key.
441445
%End
442446

443447
T defaultValue() const;
@@ -503,23 +507,25 @@ Base abstract class for settings entry which are passed by value
503507
%Docstring
504508
Constructor for QgsSettingsEntryByValue.
505509

506-
The ``key`` argument specifies the key of the settings.
507-
The ``parent`` argument specifies the parent in the tree of settings.
508-
The ``section`` argument specifies the section.
509-
The ``defaultValue`` argument specifies the default value for the settings entry.
510-
The ``description`` argument specifies a description for the settings entry.
511-
The ``options`` arguments specifies the options for the settings entry.
510+
\arg key specifies the key of the settings.
511+
\arg parent specifies the parent in the tree of settings.
512+
\arg section specifies the section.
513+
\arg defaultValue specifies the default value for the settings entry.
514+
\arg description specifies a description for the settings entry.
515+
\arg optionss specifies the options for the settings entry.
516+
517+
:raises QgsSettingsException: if the number of given parent named items doesn't match the complete key definition
512518
%End
513519

514520
QgsSettingsEntryByValue( const QString &key, const QString &section, QVariant defaultValue, const QString &description = QString(), Qgis::SettingsOptions options = Qgis::SettingsOptions() );
515521
%Docstring
516522
Constructor for QgsSettingsEntryByValue.
517523

518-
The ``key`` argument specifies the key of the settings.
519-
The ``section`` argument specifies the section.
520-
The ``defaultValue`` argument specifies the default value for the settings entry.
521-
The ``description`` argument specifies a description for the settings entry.
522-
The ``options`` arguments specifies the options for the settings entry.
524+
\arg key specifies the key of the settings.
525+
\arg section specifies the section.
526+
\arg defaultValue specifies the default value for the settings entry.
527+
\arg description specifies a description for the settings entry.
528+
\arg optionss specifies the options for the settings entry.
523529
%End
524530

525531
virtual Qgis::SettingsType settingsType() const = 0;
@@ -528,16 +534,16 @@ The ``options`` arguments specifies the options for the settings entry.
528534
%Docstring
529535
Returns settings value.
530536

531-
The ``dynamicKeyPart`` argument specifies the dynamic part of the settings key.
532-
The ``defaultValueOverride`` argument if valid is used instead of the normal default value.
537+
\arg dynamicKeyPart specifies the dynamic part of the settings key.
538+
\arg defaultValueOverride if valid is used instead of the normal default value.
533539
%End
534540

535541
T value( const QStringList &dynamicKeyPartList ) const;
536542
%Docstring
537543
Returns settings value.
538544

539-
The ``dynamicKeyPartList`` argument specifies the list of dynamic parts of the settings key.
540-
The ``defaultValueOverride`` argument if valid is used instead of the normal default value.
545+
\arg dynamicKeyPartList specifies the list of dynamic parts of the settings key.
546+
\arg defaultValueOverride if valid is used instead of the normal default value.
541547
%End
542548

543549
T valueWithDefaultOverride( T defaultValueOverride, const QString &dynamicKeyPart = QString() ) const;
@@ -571,15 +577,15 @@ Returns the settings value for the ``dynamicKeyPartList`` and with a ``defaultV
571577
Set settings value.
572578

573579
The ``value`` to set.
574-
The ``dynamicKeyPart`` argument specifies the dynamic part of the settings key.
580+
\arg dynamicKeyPart specifies the dynamic part of the settings key.
575581
%End
576582

577583
bool setValue( T value, const QStringList &dynamicKeyPartList ) const;
578584
%Docstring
579585
Set settings value.
580586

581587
The ``value`` to set.
582-
The ``dynamicKeyParts`` argument specifies the list of dynamic parts of the settings key.
588+
\arg dynamicKeyParts specifies the list of dynamic parts of the settings key.
583589
%End
584590

585591
T defaultValue() const;

‎python/core/auto_generated/settings/qgssettingstreeelement.sip.in

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ to automatically register a settings entry on its creation when a parent is prov
6464
QgsSettingsTreeElement *createChildElement( const QString &key ) throw( QgsSettingsException ) /KeepReference/;
6565
%Docstring
6666
Creates a normal tree element
67+
It will return the existing child element if it exists at the given key
68+
69+
:raises QgsSettingsException: if a setting exists with the same key
6770
%End
6871

6972
QgsSettingsTreeNamedListElement *createNamedListElement( const QString &key, const QgsSettingsTreeElement::Options &options = QgsSettingsTreeElement::Options() ) throw( QgsSettingsException ) /KeepReference/;
@@ -91,7 +94,9 @@ Registers a child setting
9194

9295
.. note::
9396

94-
This is automatically done when calling the setting's constructor with the parent argument
97+
The registration is automatically done when calling the setting's constructor with the parent argument signature
98+
99+
:raises QgsSettingsException: if a setting exists with the same key
95100
%End
96101

97102
void unregisterChildSetting( const QgsSettingsEntryBase *setting, bool deleteSettingValues = false, const QStringList &parentsNamedItems = QStringList() );
@@ -157,7 +162,7 @@ Returns the number of named elements in the complete key
157162
%End
158163

159164
protected:
160-
void registerChildElement( QgsSettingsTreeElement *element ) throw( QgsSettingsException );
165+
void registerChildElement( QgsSettingsTreeElement *element );
161166
%Docstring
162167
Registers a child elements
163168
%End
@@ -206,6 +211,8 @@ the named list element is used to store a group of settings under a dynamically
206211
Returns the list of items
207212

208213
:param parentsNamedItems: the list of named items in the parent named list (if any)
214+
215+
:raises QgsSettingsException: if the number of given parent named items doesn't match the complete key definition
209216
%End
210217

211218
QStringList items( Qgis::SettingsOrigin origin, const QStringList &parentsNamedItems = QStringList() ) const throw( QgsSettingsException );
@@ -214,6 +221,8 @@ Returns the list of items
214221

215222
:param origin: can be used to restrict the origin of the setting (local or global)
216223
:param parentsNamedItems: the list of named items in the parent named list (if any)
224+
225+
:raises QgsSettingsException: if the number of given parent named items doesn't match the complete key definition
217226
%End
218227

219228

@@ -223,13 +232,17 @@ Sets the selected named item from the named list element
223232

224233
:param item: the item to set as selected
225234
:param parentsNamedItems: the list of named items in the parent named list (if any)
235+
236+
:raises QgsSettingsException: if the number of given parent named items doesn't match the complete key definition
226237
%End
227238

228239
QString selectedItem( const QStringList &parentsNamedItems = QStringList() ) throw( QgsSettingsException );
229240
%Docstring
230241
Returns the selected named item from the named list element
231242

232243
:param parentsNamedItems: the list of named items in the parent named list (if any)
244+
245+
:raises QgsSettingsException: if the number of given parent named items doesn't match the complete key definition
233246
%End
234247

235248
void deleteItem( const QString &item, const QStringList &parentsNamedItems = QStringList() ) throw( QgsSettingsException );
@@ -238,6 +251,8 @@ Deletes a named item from the named list element
238251

239252
:param item: the item to delete
240253
:param parentsNamedItems: the list of named items in the parent named list (if any)
254+
255+
:raises QgsSettingsException: if the number of given parent named items doesn't match the complete key definition
241256
%End
242257

243258
const QgsSettingsEntryString *selectedItemSetting() const;

‎src/core/settings/qgssettings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class CORE_EXPORT QgsSettings : public QObject
117117
* Creates a settings tree element for the given \a pluginName
118118
* \since QGIS 3.30
119119
*/
120-
static QgsSettingsTreeElement *createPluginTreeElement( const QString &pluginName ) SIP_THROW( QgsSettingsException );
120+
static QgsSettingsTreeElement *createPluginTreeElement( const QString &pluginName );
121121

122122

123123
/**

‎src/core/settings/qgssettingsentry.h

Lines changed: 56 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ class CORE_EXPORT QgsSettingsEntryBase
7777
/**
7878
* Constructor for QgsSettingsEntryBase.
7979
*
80-
* The \a key argument specifies the key of the settings.
81-
* The \a section argument specifies the section.
82-
* The \a defaultValue argument specifies the default value for the settings entry.
83-
* The \a description argument specifies a description for the settings entry.
84-
* The \a options argument specifies the options for the settings entry.
80+
* \arg key specifies the key of the settings.
81+
* \arg section specifies the section.
82+
* \arg defaultValue specifies the default value for the settings entry.
83+
* \arg description specifies a description for the settings entry.
84+
* \arg options specifies the options for the settings entry.
8585
*/
8686
QgsSettingsEntryBase( const QString &key,
8787
const QString &section,
@@ -97,17 +97,18 @@ class CORE_EXPORT QgsSettingsEntryBase
9797
/**
9898
* Constructor for QgsSettingsEntryBase.
9999
*
100-
* The \a key argument specifies the key of the settings.
101-
* The \a parent argument specifies the parent in the tree of settings.
102-
* The \a defaultValue argument specifies the default value for the settings entry.
103-
* The \a description argument specifies a description for the settings entry.
104-
* The \a options argument specifies the options for the settings entry.
100+
* \arg key specifies the key of the settings.
101+
* \arg parent specifies the parent in the tree of settings.
102+
* \arg defaultValue specifies the default value for the settings entry.
103+
* \arg description specifies a description for the settings entry.
104+
* \arg options specifies the options for the settings entry.
105+
* \throws QgsSettingsException if the number of given parent named items doesn't match the complete key definition
105106
*/
106107
QgsSettingsEntryBase( const QString &key,
107108
QgsSettingsTreeElement *parentTreeElement,
108109
const QVariant &defaultValue = QVariant(),
109110
const QString &description = QString(),
110-
Qgis::SettingsOptions options = Qgis::SettingsOptions() );
111+
Qgis::SettingsOptions options = Qgis::SettingsOptions() ) SIP_THROW( QgsSettingsException );
111112

112113
/**
113114
* Destructor for QgsSettingsEntryBase.
@@ -117,14 +118,14 @@ class CORE_EXPORT QgsSettingsEntryBase
117118
/**
118119
* Returns settings entry key.
119120
*
120-
* The \a dynamicKeyPart argument specifies the dynamic part of the settings key.
121+
* \arg dynamicKeyPart specifies the dynamic part of the settings key.
121122
*/
122123
QString key( const QString &dynamicKeyPart = QString() ) const;
123124

124125
/**
125126
* Returns settings entry key.
126127
*
127-
* The \a dynamicKeyParts argument specifies the list of dynamic parts of the settings key.
128+
* \arg dynamicKeyParts specifies the list of dynamic parts of the settings key.
128129
*/
129130
QString key( const QStringList &dynamicKeyPartList ) const;
130131

@@ -135,7 +136,7 @@ class CORE_EXPORT QgsSettingsEntryBase
135136
* the settings key "NewsFeed/httpsfeedqgisorg/27/content" is valid for the settings entry
136137
* defined with the key "NewsFeed/%1/%2/content"
137138
*
138-
* The \a key to check
139+
* \arg key to check
139140
*/
140141
bool keyIsValid( const QString &key ) const;
141142

@@ -160,14 +161,14 @@ class CORE_EXPORT QgsSettingsEntryBase
160161
/**
161162
* Returns TRUE if the settings is contained in the underlying QSettings.
162163
*
163-
* The \a dynamicKeyPart argument specifies the dynamic part of the settings key.
164+
* \arg dynamicKeyPart specifies the dynamic part of the settings key.
164165
*/
165166
bool exists( const QString &dynamicKeyPart = QString() ) const;
166167

167168
/**
168169
* Returns TRUE if the settings is contained in the underlying QSettings.
169170
*
170-
* The \a dynamicKeyParts argument specifies the list of dynamic parts of the settings key.
171+
* \arg dynamicKeyParts specifies the list of dynamic parts of the settings key.
171172
*/
172173
bool exists( const QStringList &dynamicKeyPartList ) const;
173174

@@ -181,14 +182,14 @@ class CORE_EXPORT QgsSettingsEntryBase
181182
/**
182183
* Removes the settings from the underlying QSettings.
183184
*
184-
* The \a dynamicKeyPart argument specifies the dynamic part of the settings key.
185+
* \arg dynamicKeyPart specifies the dynamic part of the settings key.
185186
*/
186187
void remove( const QString &dynamicKeyPart = QString() ) const;
187188

188189
/**
189190
* Removes the settings from the underlying QSettings.
190191
*
191-
* The \a dynamicKeyParts argument specifies the list of dynamic parts of the settings key.
192+
* \arg dynamicKeyParts specifies the list of dynamic parts of the settings key.
192193
*/
193194
void remove( const QStringList &dynamicKeyPartList ) const;
194195

@@ -202,7 +203,7 @@ class CORE_EXPORT QgsSettingsEntryBase
202203
* Set settings value.
203204
*
204205
* The \a value to set.
205-
* The \a dynamicKeyPart argument specifies the dynamic part of the settings key.
206+
* \arg dynamicKeyPart specifies the dynamic part of the settings key.
206207
* \deprecated since QGIS 3.26 use setVariantValuePrivate or an implementation setValue instead
207208
*/
208209
Q_DECL_DEPRECATED virtual bool setVariantValue( const QVariant &value, const QString &dynamicKeyPart = QString() ) const SIP_DEPRECATED;
@@ -211,15 +212,15 @@ class CORE_EXPORT QgsSettingsEntryBase
211212
* Set settings value.
212213
*
213214
* The \a value to set.
214-
* The \a dynamicKeyParts argument specifies the list of dynamic parts of the settings key.
215+
* \arg dynamicKeyParts specifies the list of dynamic parts of the settings key.
215216
* \deprecated since QGIS 3.26 use setVariantValuePrivate or an implementation setValue instead
216217
*/
217218
Q_DECL_DEPRECATED virtual bool setVariantValue( const QVariant &value, const QStringList &dynamicKeyPartList ) const SIP_DEPRECATED;
218219

219-
//! Returns settings value with the \a dynamicKeyPart argument specifying the dynamic part of the settings key.
220+
//! Returns settings value with \arg dynamicKeyPart specifying the dynamic part of the settings key.
220221
QVariant valueAsVariant( const QString &dynamicKeyPart = QString() ) const;
221222

222-
//! Returns settings value with the \a dynamicKeyPart argument specifying the dynamic part of the settings key.
223+
//! Returns settings value with \arg dynamicKeyPart specifying the dynamic part of the settings key.
223224
QVariant valueAsVariant( const QStringList &dynamicKeyPartList ) const;
224225

225226
/**
@@ -231,8 +232,8 @@ class CORE_EXPORT QgsSettingsEntryBase
231232
/**
232233
* Returns settings value.
233234
*
234-
* The \a dynamicKeyPartList argument specifies the list of dynamic parts of the settings key.
235-
* The \a defaultValueOverride argument if valid is used instead of the normal default value.
235+
* \arg dynamicKeyPartList specifies the list of dynamic parts of the settings key.
236+
* \arg defaultValueOverride if valid is used instead of the normal default value.
236237
* \since QGIS 3.26
237238
*/
238239
QVariant valueAsVariantWithDefaultOverride( const QVariant &defaultValueOverride, const QStringList &dynamicKeyPartList ) const;
@@ -353,11 +354,12 @@ class QgsSettingsEntryByReference : public QgsSettingsEntryBase
353354
/**
354355
* Constructor for QgsSettingsEntryByReference.
355356
*
356-
* The \a key argument specifies the key of the settings.
357-
* The \a parent argument specifies the parent in the tree of settings.
358-
* The \a defaultValue argument specifies the default value for the settings entry.
359-
* The \a description argument specifies a description for the settings entry.
360-
* The \a options arguments specifies the options for the settings entry.
357+
* \arg key specifies the key of the settings.
358+
* \arg parent specifies the parent in the tree of settings.
359+
* \arg defaultValue specifies the default value for the settings entry.
360+
* \arg description specifies a description for the settings entry.
361+
* \arg optionss specifies the options for the settings entry.
362+
* \throws QgsSettingsException if the number of given parent named items doesn't match the complete key definition
361363
*/
362364
QgsSettingsEntryByReference( const QString &key,
363365
QgsSettingsTreeElement *parent,
@@ -370,11 +372,11 @@ class QgsSettingsEntryByReference : public QgsSettingsEntryBase
370372
/**
371373
* Constructor for QgsSettingsEntryByReference.
372374
*
373-
* The \a key argument specifies the key of the settings.
374-
* The \a section argument specifies the section.
375-
* The \a defaultValue argument specifies the default value for the settings entry.
376-
* The \a description argument specifies a description for the settings entry.
377-
* The \a options arguments specifies the options for the settings entry.
375+
* \arg key specifies the key of the settings.
376+
* \arg section specifies the section.
377+
* \arg defaultValue specifies the default value for the settings entry.
378+
* \arg description specifies a description for the settings entry.
379+
* \arg optionss specifies the options for the settings entry.
378380
*/
379381
QgsSettingsEntryByReference( const QString &key,
380382
const QString &section,
@@ -436,7 +438,7 @@ class QgsSettingsEntryByReference : public QgsSettingsEntryBase
436438
* Set settings value.
437439
*
438440
* The \a value to set.
439-
* The \a dynamicKeyPart argument specifies the dynamic part of the settings key.
441+
* \arg dynamicKeyPart specifies the dynamic part of the settings key.
440442
*/
441443
bool setValue( const T &value, const QString &dynamicKeyPart = QString() ) const
442444
{
@@ -447,7 +449,7 @@ class QgsSettingsEntryByReference : public QgsSettingsEntryBase
447449
* Set settings value.
448450
*
449451
* The \a value to set.
450-
* The \a dynamicKeyParts argument specifies the list of dynamic parts of the settings key.
452+
* \arg dynamicKeyParts specifies the list of dynamic parts of the settings key.
451453
*/
452454
bool setValue( const T &value, const QStringList &dynamicKeyPartList ) const
453455
{
@@ -515,12 +517,13 @@ class QgsSettingsEntryByValue : public QgsSettingsEntryBase
515517
/**
516518
* Constructor for QgsSettingsEntryByValue.
517519
*
518-
* The \a key argument specifies the key of the settings.
519-
* The \a parent argument specifies the parent in the tree of settings.
520-
* The \a section argument specifies the section.
521-
* The \a defaultValue argument specifies the default value for the settings entry.
522-
* The \a description argument specifies a description for the settings entry.
523-
* The \a options arguments specifies the options for the settings entry.
520+
* \arg key specifies the key of the settings.
521+
* \arg parent specifies the parent in the tree of settings.
522+
* \arg section specifies the section.
523+
* \arg defaultValue specifies the default value for the settings entry.
524+
* \arg description specifies a description for the settings entry.
525+
* \arg optionss specifies the options for the settings entry.
526+
* \throws QgsSettingsException if the number of given parent named items doesn't match the complete key definition
524527
*/
525528
QgsSettingsEntryByValue( const QString &key, QgsSettingsTreeElement *parent, QVariant defaultValue, const QString &description = QString(), Qgis::SettingsOptions options = Qgis::SettingsOptions() )
526529
: QgsSettingsEntryBase( key, parent, defaultValue, description, options )
@@ -529,11 +532,11 @@ class QgsSettingsEntryByValue : public QgsSettingsEntryBase
529532
/**
530533
* Constructor for QgsSettingsEntryByValue.
531534
*
532-
* The \a key argument specifies the key of the settings.
533-
* The \a section argument specifies the section.
534-
* The \a defaultValue argument specifies the default value for the settings entry.
535-
* The \a description argument specifies a description for the settings entry.
536-
* The \a options arguments specifies the options for the settings entry.
535+
* \arg key specifies the key of the settings.
536+
* \arg section specifies the section.
537+
* \arg defaultValue specifies the default value for the settings entry.
538+
* \arg description specifies a description for the settings entry.
539+
* \arg optionss specifies the options for the settings entry.
537540
*/
538541
QgsSettingsEntryByValue( const QString &key, const QString &section, QVariant defaultValue, const QString &description = QString(), Qgis::SettingsOptions options = Qgis::SettingsOptions() )
539542
: QgsSettingsEntryBase( key, section, defaultValue, description, options )
@@ -544,16 +547,16 @@ class QgsSettingsEntryByValue : public QgsSettingsEntryBase
544547
/**
545548
* Returns settings value.
546549
*
547-
* The \a dynamicKeyPart argument specifies the dynamic part of the settings key.
548-
* The \a defaultValueOverride argument if valid is used instead of the normal default value.
550+
* \arg dynamicKeyPart specifies the dynamic part of the settings key.
551+
* \arg defaultValueOverride if valid is used instead of the normal default value.
549552
*/
550553
T value( const QString &dynamicKeyPart = QString() ) const { return this->convertFromVariant( valueAsVariant( dynamicKeyPart ) );}
551554

552555
/**
553556
* Returns settings value.
554557
*
555-
* The \a dynamicKeyPartList argument specifies the list of dynamic parts of the settings key.
556-
* The \a defaultValueOverride argument if valid is used instead of the normal default value.
558+
* \arg dynamicKeyPartList specifies the list of dynamic parts of the settings key.
559+
* \arg defaultValueOverride if valid is used instead of the normal default value.
557560
*/
558561
T value( const QStringList &dynamicKeyPartList ) const { return this->convertFromVariant( valueAsVariant( dynamicKeyPartList ) );}
559562

@@ -591,7 +594,7 @@ class QgsSettingsEntryByValue : public QgsSettingsEntryBase
591594
* Set settings value.
592595
*
593596
* The \a value to set.
594-
* The \a dynamicKeyPart argument specifies the dynamic part of the settings key.
597+
* \arg dynamicKeyPart specifies the dynamic part of the settings key.
595598
*/
596599
bool setValue( T value, const QString &dynamicKeyPart = QString() ) const
597600
{
@@ -602,7 +605,7 @@ class QgsSettingsEntryByValue : public QgsSettingsEntryBase
602605
* Set settings value.
603606
*
604607
* The \a value to set.
605-
* The \a dynamicKeyParts argument specifies the list of dynamic parts of the settings key.
608+
* \arg dynamicKeyParts specifies the list of dynamic parts of the settings key.
606609
*/
607610
bool setValue( T value, const QStringList &dynamicKeyPartList ) const
608611
{

‎src/core/settings/qgssettingstreeelement.h

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ class CORE_EXPORT QgsSettingsTreeElement
8686
*/
8787
static QgsSettingsTreeElement *createRootElement() SIP_SKIP;
8888

89-
//! Creates a normal tree element
89+
/**
90+
* Creates a normal tree element
91+
* It will return the existing child element if it exists at the given key
92+
* \throws QgsSettingsException if a setting exists with the same key
93+
*/
9094
QgsSettingsTreeElement *createChildElement( const QString &key ) SIP_THROW( QgsSettingsException ) SIP_KEEPREFERENCE;
9195

9296
/**
@@ -104,7 +108,8 @@ class CORE_EXPORT QgsSettingsTreeElement
104108
* \param setting the setting to register
105109
* \param key the key of the setting (not the complete key from its parents)
106110
* \note Ownership of the setting is transferred
107-
* \note This is automatically done when calling the setting's constructor with the parent argument
111+
* \note The registration is automatically done when calling the setting's constructor with the parent argument signature
112+
* \throws QgsSettingsException if a setting exists with the same key
108113
*/
109114
void registerChildSetting( const QgsSettingsEntryBase *setting, const QString &key ) SIP_THROW( QgsSettingsException );
110115

@@ -155,7 +160,7 @@ class CORE_EXPORT QgsSettingsTreeElement
155160

156161
protected:
157162
//! Registers a child elements
158-
void registerChildElement( QgsSettingsTreeElement *element ) SIP_THROW( QgsSettingsException );
163+
void registerChildElement( QgsSettingsTreeElement *element );
159164

160165
Type mType = Type::Root;
161166

@@ -209,13 +214,15 @@ class CORE_EXPORT QgsSettingsTreeNamedListElement : public QgsSettingsTreeElemen
209214
/**
210215
* Returns the list of items
211216
* \param parentsNamedItems the list of named items in the parent named list (if any)
217+
* \throws QgsSettingsException if the number of given parent named items doesn't match the complete key definition
212218
*/
213219
QStringList items( const QStringList &parentsNamedItems = QStringList() ) const SIP_THROW( QgsSettingsException );
214220

215221
/**
216222
* Returns the list of items
217223
* \param origin can be used to restrict the origin of the setting (local or global)
218224
* \param parentsNamedItems the list of named items in the parent named list (if any)
225+
* \throws QgsSettingsException if the number of given parent named items doesn't match the complete key definition
219226
*/
220227
QStringList items( Qgis::SettingsOrigin origin, const QStringList &parentsNamedItems = QStringList() ) const SIP_THROW( QgsSettingsException );
221228

@@ -224,19 +231,22 @@ class CORE_EXPORT QgsSettingsTreeNamedListElement : public QgsSettingsTreeElemen
224231
* Sets the selected named item from the named list element
225232
* \param item the item to set as selected
226233
* \param parentsNamedItems the list of named items in the parent named list (if any)
234+
* \throws QgsSettingsException if the number of given parent named items doesn't match the complete key definition
227235
*/
228236
void setSelectedItem( const QString &item, const QStringList &parentsNamedItems = QStringList() ) SIP_THROW( QgsSettingsException );
229237

230238
/**
231239
* Returns the selected named item from the named list element
232240
* \param parentsNamedItems the list of named items in the parent named list (if any)
241+
* \throws QgsSettingsException if the number of given parent named items doesn't match the complete key definition
233242
*/
234243
QString selectedItem( const QStringList &parentsNamedItems = QStringList() ) SIP_THROW( QgsSettingsException );
235244

236245
/**
237246
* Deletes a named item from the named list element
238247
* \param item the item to delete
239248
* \param parentsNamedItems the list of named items in the parent named list (if any)
249+
* \throws QgsSettingsException if the number of given parent named items doesn't match the complete key definition
240250
*/
241251
void deleteItem( const QString &item, const QStringList &parentsNamedItems = QStringList() ) SIP_THROW( QgsSettingsException );
242252

0 commit comments

Comments
 (0)
Please sign in to comment.