QGIS API Documentation 3.99.0-Master (e9821da5c6b)
Loading...
Searching...
No Matches
qgssettingsregistrycore.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgssettingsregistrycore.cpp
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 ***************************************************************************/
16
17#include "pal.h"
18#include "qgis.h"
20#include "qgsgpsdetector.h"
21#include "qgslayout.h"
22#include "qgslocator.h"
24#include "qgsowsconnection.h"
25#include "qgsprocessing.h"
26#include "qgsrasterlayer.h"
27#include "qgssettings.h"
30#include "qgssettingsproxy.h"
31#include "qgsvectorlayer.h"
33
34#include <QString>
35#include <QThread>
36
37using namespace Qt::StringLiterals;
38
40
42
44
46
48
50
52
54
56
58
60
62
64
66
68
70
72
74
76
78
80
82
84
86
88
90
91
93
95
97
99
101
103
105
107
109
111
112const QgsSettingsEntryBool *QgsSettingsRegistryCore::settingsLayerTreeShowFeatureCountForNewLayers = new QgsSettingsEntryBool( u"show-feature-count-for-new-layers"_s, QgsSettingsTree::sTreeLayerTree, false, u"If true, feature counts will be shown in the layer tree for all newly added layers."_s );
113
114const QgsSettingsEntryBool *QgsSettingsRegistryCore::settingsEnableWMSTilePrefetching = new QgsSettingsEntryBool( u"enable_wms_tile_prefetch"_s, QgsSettingsTree::sTreeWms, false, u"Whether to include WMS layers when rendering tiles adjacent to the visible map area"_s );
115
117
118const QgsSettingsEntryInteger *QgsSettingsRegistryCore::settingsLayerParallelLoadingMaxCount = new QgsSettingsEntryInteger( u"provider-parallel-loading-max-count"_s, QgsSettingsTree::sTreeCore, QThread::idealThreadCount(), u"Maximum thread used to load layers in parallel"_s, Qgis::SettingsOption(), 1 );
119
120const QgsSettingsEntryBool *QgsSettingsRegistryCore::settingsLayerParallelLoading = new QgsSettingsEntryBool( u"provider-parallel-loading"_s, QgsSettingsTree::sTreeCore, true, u"Load layers in parallel (only available for some providers (GDAL and PostgreSQL)"_s, Qgis::SettingsOption() );
121
123
124const QgsSettingsEntryInteger64 *QgsSettingsRegistryCore::settingsNetworkCacheSize = new QgsSettingsEntryInteger64( u"size-bytes"_s, QgsSettingsTree::sTreeNetworkCache, 0, u"Network disk cache size in bytes (0 = automatic size)"_s );
125
127
129
130const QgsSettingsEntryStringList *QgsSettingsRegistryCore::settingsCodeExecutionTrustedProjectsFolders = new QgsSettingsEntryStringList( u"code-execution-trusted-projects-folders"_s, QgsSettingsTree::sTreeCore, QStringList(), u"Projects and folders that are trusted and allowed execution of embedded scripts"_s );
131
132const QgsSettingsEntryStringList *QgsSettingsRegistryCore::settingsCodeExecutionUntrustedProjectsFolders = new QgsSettingsEntryStringList( u"code-execution-denied-projects-folders"_s, QgsSettingsTree::sTreeCore, QStringList(), u"Projects and folders that are untrusted and denied execution of embedded scripts"_s );
133
138
142
143void QgsSettingsRegistryCore::migrateOldSettings()
144{
145 // This method triggers a ton of QgsSettings constructions and destructions, which is very expensive
146 // as it involves writing new values to the underlying ini files.
147 // Accordingly we place a hold on constructing new QgsSettings objects for the duration of the method,
148 // so that only a single QgsSettings object is created and destroyed at the end of this method.
150
151 auto settings = QgsSettings::get();
152
153 // copy values from old keys to new keys and delete the old ones
154 // for backward compatibility, old keys are recreated when the registry gets deleted
155
156 // single settings - added in 3.30
157 QgsLayout::settingsSearchPathForTemplates->copyValueFromKey( u"core/Layout/searchPathsForTemplates"_s );
158
159 QgsProcessing::settingsPreferFilenameAsLayerName->copyValueFromKey( u"Processing/Configuration/PREFER_FILENAME_AS_LAYER_NAME"_s );
160 QgsProcessing::settingsTempPath->copyValueFromKey( u"Processing/Configuration/TEMP_PATH2"_s );
161
162 QgsNetworkAccessManager::settingsNetworkTimeout->copyValueFromKey( u"qgis/networkAndProxy/networkTimeout"_s );
163
164 settingsLayerTreeShowFeatureCountForNewLayers->copyValueFromKey( u"core/layer-tree/show_feature_count_for_new_layers"_s );
165
166#if defined( HAVE_QTSERIALPORT )
167 QgsGpsDetector::settingsGpsStopBits->copyValueFromKey( u"core/gps/stop_bits"_s );
168 QgsGpsDetector::settingsGpsFlowControl->copyValueFromKey( u"core/gps/flow_control"_s );
169 QgsGpsDetector::settingsGpsDataBits->copyValueFromKey( u"core/gps/data_bits"_s );
170 QgsGpsDetector::settingsGpsParity->copyValueFromKey( u"core/gps/parity"_s );
171#endif
172
173 QgsRasterLayer::settingsRasterDefaultOversampling->copyValueFromKey( u"Raster/defaultOversampling"_s, true );
174 QgsRasterLayer::settingsRasterDefaultEarlyResampling->copyValueFromKey( u"Raster/defaultEarlyResampling"_s, true );
175
176 pal::Pal::settingsRenderingLabelCandidatesLimitPoints->copyValueFromKey( u"core/rendering/label_candidates_limit_points"_s, true );
177 pal::Pal::settingsRenderingLabelCandidatesLimitLines->copyValueFromKey( u"core/rendering/label_candidates_limit_lines"_s, true );
178 pal::Pal::settingsRenderingLabelCandidatesLimitPolygons->copyValueFromKey( u"core/rendering/label_candidates_limit_polygons"_s, true );
179
180 // handle bad migration - Fix profiles for old QGIS versions (restore the Map/scales key on windows)
181 // TODO: Remove this from QGIS 3.36
182 // PR Link: https://github.com/qgis/QGIS/pull/52580
183 if ( settings->contains( u"Map/scales"_s ) )
184 {
185 const QStringList oldScales = settings->value( u"Map/scales"_s ).toStringList();
186 if ( ! oldScales.isEmpty() && !oldScales.at( 0 ).isEmpty() )
187 settings->setValue( u"Map/scales"_s, oldScales.join( ',' ) );
188 else
189 settings->setValue( u"Map/scales"_s, Qgis::defaultProjectScales() );
190 }
191
192 // migrate only one way for map scales
193 if ( !settingsMapScales->exists() )
194 {
195 // Handle bad migration. Prefer map/scales over Map/scales
196 // TODO: Discard this part starting from QGIS 3.36
197 const QStringList oldScales = settings->value( u"map/scales"_s ).toStringList();
198 if ( ! oldScales.isEmpty() && !oldScales.at( 0 ).isEmpty() )
199 {
200 // If migration has failed before (QGIS < 3.30.2), all scales might be
201 // concatenated in the first element of the list
202 QStringList actualScales;
203 for ( const QString &element : oldScales )
204 {
205 actualScales << element.split( "," );
206 }
207 settingsMapScales->setValue( actualScales );
208 }
209 // TODO: keep only this part of the migration starting from QGIS 3.36
210 else if ( settings->contains( u"Map/scales"_s ) )
211 {
212 settingsMapScales->setValue( settings->value( u"Map/scales"_s ).toString().split( ',' ) );
213 }
214 }
215
216 // digitizing settings - added in 3.30
217 {
218 settingsDigitizingLineColor->copyValueFromKeys( u"qgis/digitizing/line_color_red"_s, u"qgis/digitizing/line_color_green"_s, u"qgis/digitizing/line_color_blue"_s, u"qgis/digitizing/line_color_alpha"_s );
219 settingsDigitizingFillColor->copyValueFromKeys( u"qgis/digitizing/fill_color_red"_s, u"qgis/digitizing/fill_color_green"_s, u"qgis/digitizing/fill_color_blue"_s, u"qgis/digitizing/fill_color_alpha"_s );
220
221 const QList<const QgsSettingsEntryBase *> settings = QgsSettingsTree::sTreeDigitizing->childrenSettings();
222 for ( const QgsSettingsEntryBase *setting : settings )
223 {
224 QString name = setting->name();
225 if (
226 name == settingsDigitizingStreamTolerance->name() ||
227 name == settingsDigitizingLineColor->name() ||
228 name == settingsDigitizingFillColor->name()
229 )
230 continue;
231 if ( name == settingsDigitizingReuseLastValues->name() )
232 {
233 name = u"reuseLastValues"_s;
234 }
235 else
236 {
237 name.replace( '-', '_' );
238 }
239 setting->copyValueFromKey( QString( "qgis/digitizing/%1" ).arg( name ) );
240 }
241 }
242
243 // locator filters - added in 3.30
244 {
245 settings->beginGroup( u"gui/locator_filters"_s );
246 const QStringList childKeys = settings->childKeys();
247 settings->endGroup();
248 for ( const QString &childKey : childKeys )
249 {
250 if ( childKey.startsWith( "enabled"_L1 ) )
251 {
252 QString filter = childKey;
253 filter.remove( u"enabled_"_s );
254 QgsLocator::settingsLocatorFilterEnabled->copyValueFromKey( u"gui/locator_filters/enabled_%1"_s, {filter}, true );
255 QgsLocator::settingsLocatorFilterDefault->copyValueFromKey( u"gui/locator_filters/default_%1"_s, {filter}, true );
256 QgsLocator::settingsLocatorFilterPrefix->copyValueFromKey( u"gui/locator_filters/prefix_%1"_s, {filter}, true );
257 }
258 }
259 }
260
261 // connections settings - added in 3.30
262 const QStringList services = {u"WMS"_s, u"WFS"_s, u"WCS"_s};
263 for ( const QString &service : services )
264 {
265 QgsSettings settings;
266 settings.beginGroup( u"qgis/connections-%1"_s.arg( service.toLower() ) );
267 const QStringList connections = settings.childGroups();
268 if ( connections.count() == 0 )
269 continue;
270 for ( const QString &connection : connections )
271 {
272 if ( settings.value( u"%1/url"_s.arg( connection ) ).toString().isEmpty() )
273 continue;
274
275 QgsOwsConnection::settingsUrl->copyValueFromKey( u"qgis/connections-%1/%2/url"_s, {service.toLower(), connection}, true );
276 QgsOwsConnection::settingsVersion->copyValueFromKey( u"qgis/connections-%1/%2/version"_s, {service.toLower(), connection}, true );
277 QgsOwsConnection::settingsIgnoreGetMapURI->copyValueFromKey( u"qgis/connections-%1/%2/ignoreGetMapURI"_s, {service.toLower(), connection}, true );
278 QgsOwsConnection::settingsIgnoreGetFeatureInfoURI->copyValueFromKey( u"qgis/connections-%1/%2/ignoreGetFeatureInfoURI"_s, {service.toLower(), connection}, true );
279 QgsOwsConnection::settingsSmoothPixmapTransform->copyValueFromKey( u"qgis/connections-%1/%2/smoothPixmapTransform"_s, {service.toLower(), connection}, true );
280 QgsOwsConnection::settingsReportedLayerExtents->copyValueFromKey( u"qgis/connections-%1/%2/reportedLayerExtents"_s, {service.toLower(), connection}, true );
281 QgsOwsConnection::settingsDpiMode->copyValueFromKey( u"qgis/connections-%1/%2/dpiMode"_s, {service.toLower(), connection}, true );
282 QgsOwsConnection::settingsTilePixelRatio->copyValueFromKey( u"qgis/connections-%1/%2/tilePixelRatio"_s, {service.toLower(), connection}, true );
283 QgsOwsConnection::settingsMaxNumFeatures->copyValueFromKey( u"qgis/connections-%1/%2/maxnumfeatures"_s, {service.toLower(), connection}, true );
284 QgsOwsConnection::settingsPagesize->copyValueFromKey( u"qgis/connections-%1/%2/pagesize"_s, {service.toLower(), connection}, true );
285 QgsOwsConnection::settingsPagingEnabled->copyValueFromKey( u"qgis/connections-%1/%2/pagingenabled"_s, {service.toLower(), connection}, true );
286 QgsOwsConnection::settingsPreferCoordinatesForWfsT11->copyValueFromKey( u"qgis/connections-%1/%2/preferCoordinatesForWfsT11"_s, {service.toLower(), connection}, true );
287 QgsOwsConnection::settingsIgnoreAxisOrientation->copyValueFromKey( u"qgis/connections-%1/%2/ignoreAxisOrientation"_s, {service.toLower(), connection}, true );
288 QgsOwsConnection::settingsInvertAxisOrientation->copyValueFromKey( u"qgis/connections-%1/%2/invertAxisOrientation"_s, {service.toLower(), connection}, true );
289
291 settings.beginGroup( connection );
292 QgsOwsConnection::settingsHeaders->setValue( QgsHttpHeaders( settings ).headers(), {service.toLower(), connection} );
293 settings.remove( u"http-header"_s );
294 settings.endGroup();
296
297 QgsOwsConnection::settingsUsername->copyValueFromKey( u"qgis/connections/%1/%2/username"_s.arg( service, connection ), {service.toLower(), connection}, true );
298 QgsOwsConnection::settingsPassword->copyValueFromKey( u"qgis/connections/%1/%2/password"_s.arg( service, connection ), {service.toLower(), connection}, true );
299 QgsOwsConnection::settingsAuthCfg->copyValueFromKey( u"qgis/connections/%1/%2/authcfg"_s.arg( service, connection ), {service.toLower(), connection}, true );
300 }
301 if ( settings.contains( u"selected"_s ) )
302 QgsOwsConnection::sTreeOwsConnections->setSelectedItem( settings.value( u"selected"_s ).toString(), {service.toLower()} );
303 }
304
305 // Vector tile - added in 3.30
306 {
307 QgsSettings settings;
308 settings.beginGroup( u"qgis/connections-vector-tile"_s );
309 const QStringList connections = settings.childGroups();
310 for ( const QString &connection : connections )
311 {
312 if ( settings.value( u"%1/url"_s.arg( connection ) ).toString().isEmpty() )
313 continue;
314
315 QgsVectorTileProviderConnection::settingsUrl->copyValueFromKey( u"qgis/connections-vector-tile/%1/url"_s, {connection}, true );
316 QgsVectorTileProviderConnection::settingsZmin->copyValueFromKey( u"qgis/connections-vector-tile/%1/zmin"_s, {connection}, true );
317 QgsVectorTileProviderConnection::settingsZmax->copyValueFromKey( u"qgis/connections-vector-tile/%1/zmax"_s, {connection}, true );
318 QgsVectorTileProviderConnection::settingsAuthcfg->copyValueFromKey( u"qgis/connections-vector-tile/%1/authcfg"_s, {connection}, true );
319 QgsVectorTileProviderConnection::settingsUsername->copyValueFromKey( u"qgis/connections-vector-tile/%1/username"_s, {connection}, true );
320 QgsVectorTileProviderConnection::settingsPassword->copyValueFromKey( u"qgis/connections-vector-tile/%1/password"_s, {connection}, true );
321 QgsVectorTileProviderConnection::settingsStyleUrl->copyValueFromKey( u"qgis/connections-vector-tile/%1/styleUrl"_s, {connection}, true );
322 QgsVectorTileProviderConnection::settingsServiceType->copyValueFromKey( u"qgis/connections-vector-tile/%1/serviceType"_s, {connection}, true );
324 settings.beginGroup( connection );
325 QgsVectorTileProviderConnection::settingsHeaders->setValue( QgsHttpHeaders( settings ).headers(), connection );
326 settings.remove( u"http-header"_s );
327 settings.endGroup();
329 }
330 }
331
332 // xyz - added in 3.30
333 {
334 QgsSettings settings;
335 settings.beginGroup( u"qgis/connections-xyz"_s );
336 const QStringList connections = settings.childGroups();
337 for ( const QString &connection : connections )
338 {
339 if ( settings.value( u"%1/url"_s.arg( connection ) ).toString().isEmpty() )
340 continue;
341
342 QgsXyzConnectionSettings::settingsUrl->copyValueFromKey( u"qgis/connections-xyz/%1/url"_s, {connection}, true );
343 QgsXyzConnectionSettings::settingsZmin->copyValueFromKey( u"qgis/connections-xyz/%1/zmin"_s, {connection}, true );
344 QgsXyzConnectionSettings::settingsZmax->copyValueFromKey( u"qgis/connections-xyz/%1/zmax"_s, {connection}, true );
345 QgsXyzConnectionSettings::settingsAuthcfg->copyValueFromKey( u"qgis/connections-xyz/%1/authcfg"_s, {connection}, true );
346 QgsXyzConnectionSettings::settingsUsername->copyValueFromKey( u"qgis/connections-xyz/%1/username"_s, {connection}, true );
347 QgsXyzConnectionSettings::settingsPassword->copyValueFromKey( u"qgis/connections-xyz/%1/password"_s, {connection}, true );
348 QgsXyzConnectionSettings::settingsTilePixelRatio->copyValueFromKey( u"qgis/connections-xyz/%1/tilePixelRatio"_s, {connection}, true );
349 QgsXyzConnectionSettings::settingsHidden->copyValueFromKey( u"qgis/connections-xyz/%1/hidden"_s, {connection}, true );
350 QgsXyzConnectionSettings::settingsInterpretation->copyValueFromKey( u"qgis/connections-xyz/%1/interpretation"_s, {connection}, true );
352 settings.beginGroup( connection );
353 QgsXyzConnectionSettings::settingsHeaders->setValue( QgsHttpHeaders( settings ).headers(), connection );
354 settings.remove( u"http-header"_s );
355 settings.endGroup();
357 }
358 }
359
360 // arcgis - added in 3.30
361 {
362 // arcgismapserver entries are not used anymore (even in 3.28, only arcgisfeature server is used)
363 const QStringList serviceKeys = {u"qgis/connections-arcgisfeatureserver"_s, u"qgis/connections-arcgismapserver"_s};
364 QgsSettings settings;
365 for ( const QString &serviceKey : serviceKeys )
366 {
367 settings.beginGroup( serviceKey );
368 const QStringList connections = settings.childGroups();
369 for ( const QString &connection : connections )
370 {
371 QgsArcGisConnectionSettings::settingsUrl->copyValueFromKey( u"qgis/connections-arcgisfeatureserver/%1/url"_s, {connection}, true );
372 QgsArcGisConnectionSettings::settingsAuthcfg->copyValueFromKey( u"qgis/ARCGISFEATURESERVER/%1/authcfg"_s, {connection}, true );
373 QgsArcGisConnectionSettings::settingsUsername->copyValueFromKey( u"qgis/ARCGISFEATURESERVER/%1/username"_s, {connection}, true );
374 QgsArcGisConnectionSettings::settingsPassword->copyValueFromKey( u"qgis/ARCGISFEATURESERVER/%1/password"_s, {connection}, true );
375 QgsArcGisConnectionSettings::settingsContentEndpoint->copyValueFromKey( u"qgis/connections-arcgisfeatureserver/%1/content_endpoint"_s, {connection}, true );
376 QgsArcGisConnectionSettings::settingsCommunityEndpoint->copyValueFromKey( u"qgis/connections-arcgisfeatureserver/%1/community_endpoint"_s, {connection}, true );
378 settings.beginGroup( connection );
379 QgsArcGisConnectionSettings::settingsHeaders->setValue( QgsHttpHeaders( settings ).headers(), connection );
380 settings.remove( u"http-header"_s );
381 settings.endGroup();
383 }
384 settings.remove( serviceKey );
385 }
386 }
387
388 // babel devices settings - added in 3.30
389 {
390 if ( QgsBabelFormatRegistry::sTreeBabelDevices->items().count() == 0 )
391 {
392 const QStringList deviceNames = settings->value( u"/Plugin-GPS/devices/deviceList"_s ).toStringList();
393
394 for ( const QString &device : deviceNames )
395 {
396 QgsBabelFormatRegistry::settingsBabelWptDownload->copyValueFromKey( u"/Plugin-GPS/devices/%1/wptdownload"_s, {device}, true );
397 QgsBabelFormatRegistry::settingsBabelWptUpload->copyValueFromKey( u"/Plugin-GPS/devices/%1/wptupload"_s, {device}, true );
398 QgsBabelFormatRegistry::settingsBabelRteDownload->copyValueFromKey( u"/Plugin-GPS/devices/%1/rtedownload"_s, {device}, true );
399 QgsBabelFormatRegistry::settingsBabelRteUpload->copyValueFromKey( u"/Plugin-GPS/devices/%1/rteupload"_s, {device}, true );
400 QgsBabelFormatRegistry::settingsBabelTrkDownload->copyValueFromKey( u"/Plugin-GPS/devices/%1/trkdownload"_s, {device}, true );
401 QgsBabelFormatRegistry::settingsBabelTrkUpload->copyValueFromKey( u"/Plugin-GPS/devices/%1/trkupload"_s, {device}, true );
402 }
403 }
404 }
405
407}
408
409// TODO QGIS 5.0: Remove
410void QgsSettingsRegistryCore::backwardCompatibility()
411{
412 // This method triggers a ton of QgsSettings constructions and destructions, which is very expensive
413 // as it involves writing new values to the underlying ini files.
414 // Accordingly we place a hold on constructing new QgsSettings objects for the duration of the method,
415 // so that only a single QgsSettings object is created and destroyed at the end of this method.
417 auto settings = QgsSettings::get();
418
419 // CAREFUL! There's a mix of copyValueToKeyIfChanged and copyValueToKey used here.
420 // copyValueToKeyIfChanged should be used if copyValueFromKey did NOT have the removeSettingAtKey argument set to True
421 // in migrateOldSettings
422
423 // single settings - added in 3.30
424 QgsLayout::settingsSearchPathForTemplates->copyValueToKeyIfChanged( u"core/Layout/searchPathsForTemplates"_s );
425
426 QgsProcessing::settingsPreferFilenameAsLayerName->copyValueToKeyIfChanged( u"Processing/Configuration/PREFER_FILENAME_AS_LAYER_NAME"_s );
427 QgsProcessing::settingsTempPath->copyValueToKeyIfChanged( u"Processing/Configuration/TEMP_PATH2"_s );
428
429 QgsNetworkAccessManager::settingsNetworkTimeout->copyValueToKeyIfChanged( u"qgis/networkAndProxy/networkTimeout"_s );
430
431 settingsLayerTreeShowFeatureCountForNewLayers->copyValueToKeyIfChanged( u"core/layer-tree/show_feature_count_for_new_layers"_s );
432
433#if defined( HAVE_QTSERIALPORT )
434 QgsGpsDetector::settingsGpsStopBits->copyValueToKeyIfChanged( u"core/gps/stop_bits"_s );
435 QgsGpsDetector::settingsGpsFlowControl->copyValueToKeyIfChanged( u"core/gps/flow_control"_s );
436 QgsGpsDetector::settingsGpsDataBits->copyValueToKeyIfChanged( u"core/gps/data_bits"_s );
437 QgsGpsDetector::settingsGpsParity->copyValueToKeyIfChanged( u"core/gps/parity"_s );
438#endif
439
440 QgsRasterLayer::settingsRasterDefaultOversampling->copyValueToKey( u"Raster/defaultOversampling"_s );
441 QgsRasterLayer::settingsRasterDefaultEarlyResampling->copyValueToKey( u"Raster/defaultEarlyResampling"_s );
442
443 pal::Pal::settingsRenderingLabelCandidatesLimitPoints->copyValueToKey( u"core/rendering/label_candidates_limit_points"_s );
444 pal::Pal::settingsRenderingLabelCandidatesLimitLines->copyValueToKey( u"core/rendering/label_candidates_limit_lines"_s );
445 pal::Pal::settingsRenderingLabelCandidatesLimitPolygons->copyValueToKey( u"core/rendering/label_candidates_limit_polygons"_s );
446
447 // digitizing settings - added in 3.30
448 {
449 if ( settingsDigitizingLineColor->hasChanged() )
450 settingsDigitizingLineColor->copyValueToKeys( u"qgis/digitizing/line_color_red"_s, u"qgis/digitizing/line_color_green"_s, u"qgis/digitizing/line_color_blue"_s, u"qgis/digitizing/line_color_alpha"_s );
451 if ( settingsDigitizingFillColor->hasChanged() )
452 settingsDigitizingFillColor->copyValueToKeys( u"qgis/digitizing/fill_color_red"_s, u"qgis/digitizing/fill_color_green"_s, u"qgis/digitizing/fill_color_blue"_s, u"qgis/digitizing/fill_color_alpha"_s );
453
454 const QList<const QgsSettingsEntryBase *> settings = QgsSettingsTree::sTreeDigitizing->childrenSettings();
455 for ( const QgsSettingsEntryBase *setting : settings )
456 {
457 QString name = setting->name();
458 if (
459 name == settingsDigitizingLineColor->name() ||
460 name == settingsDigitizingFillColor->name()
461 )
462 continue;
463 if ( name == settingsDigitizingReuseLastValues->name() )
464 {
465 name = u"reuseLastValues"_s;
466 }
467 else
468 {
469 name.replace( '-', '_' );
470 }
471 setting->copyValueToKeyIfChanged( QString( "qgis/digitizing/%1" ).arg( name ) );
472 }
473 }
474
475 // locator filters - added in 3.30
476 {
477 const QStringList filters = QgsLocator::sTreeLocatorFilters->items();
478 for ( const QString &filter : filters )
479 {
480 QgsLocator::settingsLocatorFilterEnabled->copyValueToKey( u"gui/locator_filters/enabled_%1"_s, {filter} );
481 QgsLocator::settingsLocatorFilterDefault->copyValueToKey( u"gui/locator_filters/default_%1"_s, {filter} );
482 QgsLocator::settingsLocatorFilterPrefix->copyValueToKey( u"gui/locator_filters/prefix_%1"_s, {filter} );
483 }
484 }
485
486 // OWS connections settings - added in 3.30
487 {
488 const QStringList services = {u"WMS"_s, u"WFS"_s, u"WCS"_s};
489 for ( const QString &service : services )
490 {
491 const QStringList connections = QgsOwsConnection::sTreeOwsConnections->items( {service.toLower()} );
492 if ( connections.count() == 0 )
493 continue;
494
495 for ( const QString &connection : connections )
496 {
497 QgsOwsConnection::settingsUrl->copyValueToKey( u"qgis/connections-%1/%2/url"_s, {service.toLower(), connection} );
498 QgsOwsConnection::settingsVersion->copyValueToKey( u"qgis/connections-%1/%2/version"_s, {service.toLower(), connection} );
499 QgsOwsConnection::settingsIgnoreGetMapURI->copyValueToKey( u"qgis/connections-%1/%2/ignoreGetMapURI"_s, {service.toLower(), connection} );
500 QgsOwsConnection::settingsIgnoreGetFeatureInfoURI->copyValueToKey( u"qgis/connections-%1/%2/ignoreGetFeatureInfoURI"_s, {service.toLower(), connection} );
501 QgsOwsConnection::settingsSmoothPixmapTransform->copyValueToKey( u"qgis/connections-%1/%2/smoothPixmapTransform"_s, {service.toLower(), connection} );
502 QgsOwsConnection::settingsReportedLayerExtents->copyValueToKey( u"qgis/connections-%1/%2/reportedLayerExtents"_s, {service.toLower(), connection} );
503 QgsOwsConnection::settingsDpiMode->copyValueToKey( u"qgis/connections-%1/%2/dpiMode"_s, {service.toLower(), connection} );
504 QgsOwsConnection::settingsTilePixelRatio->copyValueToKey( u"qgis/connections-%1/%2/tilePixelRatio"_s, {service.toLower(), connection} );
505 QgsOwsConnection::settingsMaxNumFeatures->copyValueToKey( u"qgis/connections-%1/%2/maxnumfeatures"_s, {service.toLower(), connection} );
506 QgsOwsConnection::settingsPagesize->copyValueToKey( u"qgis/connections-%1/%2/pagesize"_s, {service.toLower(), connection} );
507 QgsOwsConnection::settingsPagingEnabled->copyValueToKey( u"qgis/connections-%1/%2/pagingenabled"_s, {service.toLower(), connection} );
508 QgsOwsConnection::settingsPreferCoordinatesForWfsT11->copyValueToKey( u"qgis/connections-%1/%2/preferCoordinatesForWfsT11"_s, {service.toLower(), connection} );
509 QgsOwsConnection::settingsIgnoreAxisOrientation->copyValueToKey( u"qgis/connections-%1/%2/ignoreAxisOrientation"_s, {service.toLower(), connection} );
510 QgsOwsConnection::settingsInvertAxisOrientation->copyValueToKey( u"qgis/connections-%1/%2/invertAxisOrientation"_s, {service.toLower(), connection} );
511
512 if ( QgsOwsConnection::settingsHeaders->exists( {service.toLower(), connection} ) )
513 {
515 const QgsHttpHeaders headers = QgsHttpHeaders( QgsOwsConnection::settingsHeaders->value( {service.toLower(), connection} ) );
516 settings->beginGroup( u"qgis/connections-%1/%2"_s.arg( service.toLower(), connection ) );
517 headers.updateSettings( *settings );
518 settings->endGroup();
520 }
521
522 QgsOwsConnection::settingsUsername->copyValueToKey( u"qgis/connections/%1/%2/username"_s.arg( service, connection ), {service.toLower(), connection} );
523 QgsOwsConnection::settingsPassword->copyValueToKey( u"qgis/connections/%1/%2/password"_s.arg( service, connection ), {service.toLower(), connection} );
524 QgsOwsConnection::settingsAuthCfg->copyValueToKey( u"qgis/connections/%1/%2/authcfg"_s.arg( service, connection ), {service.toLower(), connection} );
525 }
526 }
527 }
528
529// Vector tile - added in 3.30
530 {
531 const QStringList connections = QgsVectorTileProviderConnection::sTreeConnectionVectorTile->items();
532
533 for ( const QString &connection : connections )
534 {
535 // do not overwrite already set setting
536 QgsVectorTileProviderConnection::settingsUrl->copyValueToKey( u"qgis/connections-vector-tile/%1/url"_s, {connection} );
537 QgsVectorTileProviderConnection::settingsZmin->copyValueToKey( u"qgis/connections-vector-tile/%1/zmin"_s, {connection} );
538 QgsVectorTileProviderConnection::settingsZmax->copyValueToKey( u"qgis/connections-vector-tile/%1/zmax"_s, {connection} );
539 QgsVectorTileProviderConnection::settingsAuthcfg->copyValueToKey( u"qgis/connections-vector-tile/%1/authcfg"_s, {connection} );
540 QgsVectorTileProviderConnection::settingsUsername->copyValueToKey( u"qgis/connections-vector-tile/%1/username"_s, {connection} );
541 QgsVectorTileProviderConnection::settingsPassword->copyValueToKey( u"qgis/connections-vector-tile/%1/password"_s, {connection} );
542 QgsVectorTileProviderConnection::settingsStyleUrl->copyValueToKey( u"qgis/connections-vector-tile/%1/styleUrl"_s, {connection} );
543 QgsVectorTileProviderConnection::settingsServiceType->copyValueToKey( u"qgis/connections-vector-tile/%1/serviceType"_s, {connection} );
544
545 if ( QgsVectorTileProviderConnection::settingsHeaders->exists( connection ) )
546 {
547 Q_NOWARN_DEPRECATED_PUSH const QgsHttpHeaders headers = QgsHttpHeaders( QgsVectorTileProviderConnection::settingsHeaders->value( connection ) );
548 settings->beginGroup( u"qgis/connections-vector-tile/%1"_s.arg( connection ) );
549 headers.updateSettings( *settings );
550 settings->endGroup();
552 }
553 }
554 }
555
556 // xyz - added in 3.30
557 {
558 const QStringList connections = QgsXyzConnectionSettings::sTreeXyzConnections->items();
559 for ( const QString &connection : connections )
560 {
561 QgsXyzConnectionSettings::settingsUrl->copyValueToKey( u"qgis/connections-xyz/%1/url"_s, {connection} );
562 QgsXyzConnectionSettings::settingsZmin->copyValueToKey( u"qgis/connections-xyz/%1/zmin"_s, {connection} );
563 QgsXyzConnectionSettings::settingsZmax->copyValueToKey( u"qgis/connections-xyz/%1/zmax"_s, {connection} );
564 QgsXyzConnectionSettings::settingsAuthcfg->copyValueToKey( u"qgis/connections-xyz/%1/authcfg"_s, {connection} );
565 QgsXyzConnectionSettings::settingsUsername->copyValueToKey( u"qgis/connections-xyz/%1/username"_s, {connection} );
566 QgsXyzConnectionSettings::settingsPassword->copyValueToKey( u"qgis/connections-xyz/%1/password"_s, {connection} );
567 QgsXyzConnectionSettings::settingsTilePixelRatio->copyValueToKey( u"qgis/connections-xyz/%1/tilePixelRatio"_s, {connection} );
568 QgsXyzConnectionSettings::settingsHidden->copyValueToKey( u"qgis/connections-xyz/%1/hidden"_s, {connection} );
569 QgsXyzConnectionSettings::settingsInterpretation->copyValueToKey( u"qgis/connections-xyz/%1/interpretation"_s, {connection} );
570
571 if ( QgsXyzConnectionSettings::settingsHeaders->exists( connection ) )
572 {
574 const QgsHttpHeaders headers = QgsHttpHeaders( QgsXyzConnectionSettings::settingsHeaders->value( connection ) );
575 settings->beginGroup( u"qgis/connections-xyz/%1"_s.arg( connection ) );
576 headers.updateSettings( *settings );
577 settings->endGroup();
579 }
580 }
581 }
582
583 // Arcgis - added in 3.30
584 {
585 const QStringList connections = QgsArcGisConnectionSettings::sTreeConnectionArcgis->items();
586 for ( const QString &connection : connections )
587 {
588 // do not overwrite already set setting
589 QgsArcGisConnectionSettings::settingsUrl->copyValueToKey( u"qgis/connections-arcgisfeatureserver/%1/url"_s, {connection} );
590 QgsArcGisConnectionSettings::settingsAuthcfg->copyValueToKey( u"qgis/ARCGISFEATURESERVER/%1/authcfg"_s, {connection} );
591 QgsArcGisConnectionSettings::settingsUsername->copyValueToKey( u"qgis/ARCGISFEATURESERVER/%1/username"_s, {connection} );
592 QgsArcGisConnectionSettings::settingsPassword->copyValueToKey( u"qgis/ARCGISFEATURESERVER/%1/password"_s, {connection} );
593 QgsArcGisConnectionSettings::settingsContentEndpoint->copyValueToKey( u"qgis/connections-arcgisfeatureserver/%1/content_endpoint"_s, {connection} );
594 QgsArcGisConnectionSettings::settingsCommunityEndpoint->copyValueToKey( u"qgis/connections-arcgisfeatureserver/%1/community_endpoint"_s, {connection} );
595 if ( QgsArcGisConnectionSettings::settingsHeaders->exists( connection ) )
596 {
597 if ( QgsArcGisConnectionSettings::settingsHeaders->exists( connection ) )
598 {
600 const QgsHttpHeaders headers = QgsHttpHeaders( QgsArcGisConnectionSettings::settingsHeaders->value( connection ) );
601 settings->beginGroup( u"qgis/connections-arcgisfeatureserver/%1"_s.arg( connection ) );
602 headers.updateSettings( *settings );
603 settings->endGroup();
605 }
606 }
607 }
608 }
609
610 // babel devices settings - added in 3.30
611 {
612 const QStringList devices = QgsBabelFormatRegistry::sTreeBabelDevices->items();
613 settings->setValue( u"/Plugin-GPS/devices/deviceList"_s, devices );
614 for ( const QString &device : devices )
615 {
616 QgsBabelFormatRegistry::settingsBabelWptDownload->copyValueToKey( u"/Plugin-GPS/devices/%1/wptdownload"_s, {device} );
617 QgsBabelFormatRegistry::settingsBabelWptUpload->copyValueToKey( u"/Plugin-GPS/devices/%1/wptupload"_s, {device} );
618 QgsBabelFormatRegistry::settingsBabelRteDownload->copyValueToKey( u"/Plugin-GPS/devices/%1/rtedownload"_s, {device} );
619 QgsBabelFormatRegistry::settingsBabelRteUpload->copyValueToKey( u"/Plugin-GPS/devices/%1/rteupload"_s, {device} );
620 QgsBabelFormatRegistry::settingsBabelTrkDownload->copyValueToKey( u"/Plugin-GPS/devices/%1/trkdownload"_s, {device} );
621 QgsBabelFormatRegistry::settingsBabelTrkUpload->copyValueToKey( u"/Plugin-GPS/devices/%1/trkupload"_s, {device} );
622 }
623 }
624
626}
627
SettingsOption
Settings options.
Definition qgis.h:743
static const Qgis::MapToolUnit DEFAULT_SNAP_UNITS
Default snapping distance units.
Definition qgis.h:6533
@ Pixels
Pixels unit of tolerance.
Definition qgis.h:5079
static const double DEFAULT_Z_COORDINATE
Default Z coordinate value.
Definition qgis.h:6510
@ Vertex
On vertices.
Definition qgis.h:770
static const double DEFAULT_SNAP_TOLERANCE
Default snapping distance tolerance.
Definition qgis.h:6528
static const double DEFAULT_M_COORDINATE
Default M coordinate value.
Definition qgis.h:6517
static QString defaultProjectScales()
A string with default project scales.
Definition qgis.cpp:676
@ Round
Use rounded joins.
Definition qgis.h:2180
@ Round
Round cap.
Definition qgis.h:2167
@ ControlPoints
Direct control points mode - the curve is attracted to control points but does not pass through them.
Definition qgis.h:420
@ Ask
User is prompted before running scripts.
Definition qgis.h:445
@ AllLayers
On all vector layers.
Definition qgis.h:758
static const QgsSettingsEntryString * settingsUsername
static const QgsSettingsEntryString * settingsUrl
static const QgsSettingsEntryString * settingsPassword
static const QgsSettingsEntryVariantMap * settingsHeaders
static const QgsSettingsEntryString * settingsContentEndpoint
static QgsSettingsTreeNamedListNode * sTreeConnectionArcgis
static const QgsSettingsEntryString * settingsAuthcfg
static const QgsSettingsEntryString * settingsCommunityEndpoint
static const QgsSettingsEntryString * settingsBabelWptDownload
static const QgsSettingsEntryString * settingsBabelRteUpload
static const QgsSettingsEntryString * settingsBabelTrkDownload
static const QgsSettingsEntryString * settingsBabelWptUpload
static const QgsSettingsEntryString * settingsBabelTrkUpload
static QgsSettingsTreeNamedListNode * sTreeBabelDevices
static const QgsSettingsEntryString * settingsBabelRteDownload
static const QgsSettingsEntryStringList * settingsSearchPathForTemplates
Settings entry search path for templates.
Definition qgslayout.h:664
static QgsSettingsTreeNamedListNode * sTreeLocatorFilters
Definition qgslocator.h:163
static const QgsSettingsEntryBool * settingsLocatorFilterDefault
Settings entry locator filter default value.
Definition qgslocator.h:168
static const QgsSettingsEntryBool * settingsLocatorFilterEnabled
Settings entry locator filter enabled.
Definition qgslocator.h:166
static const QgsSettingsEntryString * settingsLocatorFilterPrefix
Settings entry locator filter prefix.
Definition qgslocator.h:170
static const QgsSettingsEntryInteger * settingsNetworkTimeout
Settings entry network timeout.
static const QgsSettingsEntryBool * settingsPreferCoordinatesForWfsT11
static const QgsSettingsEntryString * settingsPagingEnabled
static const QgsSettingsEntryString * settingsMaxNumFeatures
static QgsSettingsTreeNamedListNode * sTreeOwsConnections
static const QgsSettingsEntryBool * settingsIgnoreGetFeatureInfoURI
static const QgsSettingsEntryString * settingsPassword
static const QgsSettingsEntryBool * settingsReportedLayerExtents
static const QgsSettingsEntryEnumFlag< Qgis::DpiMode > * settingsDpiMode
static const QgsSettingsEntryBool * settingsIgnoreAxisOrientation
static const QgsSettingsEntryBool * settingsInvertAxisOrientation
static const QgsSettingsEntryString * settingsVersion
static const QgsSettingsEntryString * settingsPagesize
static const QgsSettingsEntryString * settingsAuthCfg
static const QgsSettingsEntryEnumFlag< Qgis::TilePixelRatio > * settingsTilePixelRatio
static const QgsSettingsEntryVariantMap * settingsHeaders
static const QgsSettingsEntryString * settingsUsername
static const QgsSettingsEntryBool * settingsSmoothPixmapTransform
static const QgsSettingsEntryString * settingsUrl
static const QgsSettingsEntryBool * settingsIgnoreGetMapURI
static const QgsSettingsEntryString * settingsTempPath
Settings entry temp path.
static const QgsSettingsEntryBool * settingsPreferFilenameAsLayerName
Settings entry prefer filename as layer name.
static const QgsSettingsEntryBool * settingsRasterDefaultEarlyResampling
static const QgsSettingsEntryDouble * settingsRasterDefaultOversampling
bool setValue(const T &value, const QString &dynamicKeyPart=QString()) const
Set settings value.
bool copyValueFromKey(const QString &key, bool removeSettingAtKey=false) const
Copies the value from a given key if it exists.
void copyValueToKeyIfChanged(const QString &key, const QStringList &dynamicKeyPartList=QStringList()) const
Copies the settings to the given key, if it has changed during the current QGIS session (see hasChang...
void copyValueToKey(const QString &key, const QStringList &dynamicKeyPartList=QStringList()) const
Copies the settings to the given key.
A boolean settings entry.
A color settings entry.
A double settings entry.
A template class for enum and flag settings entry.
A 64 bits integer (long long) settings entry.
An integer settings entry.
A string list settings entry.
A string settings entry.
static const QgsSettingsEntryDouble * settingsDigitizingSearchRadiusVertexEdit
Settings entry digitizing search radius vertex edit.
static const QgsSettingsEntryBool * settingsDigitizingDefaultSnapEnabled
Settings entry digitizing default snap enabled.
static const QgsSettingsEntryEnumFlag< Qgis::MapToolUnit > * settingsDigitizingDefaultSnappingToleranceUnit
Settings entry digitizing default snapping tolerance unit.
static const QgsSettingsEntryDouble * settingsDigitizingOffsetMiterLimit
Settings entry digitizing offset miter limit.
static const QgsSettingsEntryStringList * settingsCodeExecutionTrustedProjectsFolders
Settings entry for projects and folders that are allowed execution of embedded scripts across session...
static const QgsSettingsEntryEnumFlag< Qgis::JoinStyle > * settingsDigitizingOffsetJoinStyle
Settings entry digitizing offset join style.
static const QgsSettingsEntryDouble * settingsDigitizingMarkerSizeMm
Settings entry digitizing marker size mm.
static const QgsSettingsEntryEnumFlag< Qgis::MapToolUnit > * settingsDigitizingSearchRadiusVertexEditUnit
Settings entry digitizing search radius vertex edit unit.
static const QgsSettingsEntryBool * settingsLayerTreeShowFeatureCountForNewLayers
Settings entry show feature counts for newly added layers by default.
static const QgsSettingsEntryInteger * settingsDigitizingTracingMaxFeatureCount
Settings entry digitizing tracing max feature count.
static const QgsSettingsEntryColor * settingsDigitizingFillColor
Settings entry digitizing fill color.
static const QgsSettingsEntryBool * settingsAutosizeAttributeTable
Settings entry autosize columns by default when opening attribute table.
static const QgsSettingsEntryBool * settingsDigitizingDisableEnterAttributeValuesDialog
Settings entry digitizing disable enter attribute values dialog.
static const QgsSettingsEntryStringList * settingsCodeExecutionUntrustedProjectsFolders
Settings entry for projects and folders that are denied execution of embedded scripts across sessions...
static const QgsSettingsEntryDouble * settingsDigitizingDefaultSnappingTolerance
Settings entry digitizing default snapping tolerance.
static const QgsSettingsEntryInteger * settingsDigitizingLineWidth
Settings entry digitizing line width.
static const QgsSettingsEntryInteger * settingsDigitizingStreamTolerance
Settings entry digitizing stream tolerance.
static const QgsSettingsEntryBool * settingsDigitizingSnapTooltip
Settings entry digitizing snap tooltip.
static const QgsSettingsEntryEnumFlag< Qgis::SnappingMode > * settingsDigitizingDefaultSnapMode
Settings entry digitizing default snap type.
static const QgsSettingsEntryInteger64 * settingsNetworkCacheSize
Settings entry network cache directory.
static const QgsSettingsEntryBool * settingsDigitizingSnapInvisibleFeature
Settings entry digitizing snap invisible feature.
static const QgsSettingsEntryDouble * settingsDigitizingLineColorAlphaScale
Settings entry digitizing line color alpha scale.
static const QgsSettingsEntryDouble * settingsDigitizingDefaultMValue
Settings entry digitizing default m value.
static const QgsSettingsEntryBool * settingsDigitizingLineGhost
Settings entry digitizing line ghost.
static const QgsSettingsEntryBool * settingsDigitizingMarkerOnlyForSelected
Settings entry digitizing marker only for selected.
static const QgsSettingsEntryColor * settingsDigitizingSnapColor
Settings entry digitizing snap color.
static const QgsSettingsEntryInteger * settingsDigitizingNurbsDegree
Settings entry digitizing NURBS curve degree.
static const QgsSettingsEntryDouble * settingsDigitizingConvertToCurveAngleTolerance
Settings entry digitizing convert to curve angle tolerance.
static const QgsSettingsEntryString * settingsGpsBabelPath
Settings entry path to GPSBabel executable.
static const QgsSettingsEntryDouble * settingsDigitizingConvertToCurveDistanceTolerance
Settings entry digitizing convert to curve distance tolerance.
static const QgsSettingsEntryInteger * settingsDigitizingValidateGeometries
Settings entry digitizing validate geometries.
static const QgsSettingsEntryColor * settingsDigitizingLineColor
Settings entry digitizing line color.
static const QgsSettingsEntryInteger * settingsLayerParallelLoadingMaxCount
Settings entry maximum thread count used to load layer in parallel.
static const QgsSettingsEntryBool * settingsDigitizingReuseLastValues
Settings entry digitizing reuseLastValues.
static const QgsSettingsEntryStringList * settingsMapScales
static const QgsSettingsEntryBool * settingsLayerParallelLoading
Settings entry whether layer are loading in parallel.
static const QgsSettingsEntryBool * settingsEnableWMSTilePrefetching
Settings entry enable WMS tile prefetching.
static const QgsSettingsEntryEnumFlag< Qgis::EndCapStyle > * settingsDigitizingOffsetCapStyle
Settings entry digitizing offset cap style.
static const QgsSettingsEntryEnumFlag< Qgis::NurbsMode > * settingsDigitizingNurbsMode
Settings entry digitizing NURBS mode.
static const QgsSettingsEntryEnumFlag< Qgis::SnappingType > * settingsDigitizingDefaultSnapType
Settings entry digitizing default snap type.
static const QgsSettingsEntryBool * settingsDigitizingConvertToCurve
Settings entry digitizing convert to curve.
static const QgsSettingsEntryDouble * settingsDigitizingDefaultZValue
Settings entry digitizing default z value.
static const QgsSettingsEntryString * settingsDigitizingMarkerStyle
Settings entry digitizing marker style.
static const QgsSettingsEntryBool * settingsDigitizingOffsetShowAdvanced
Settings entry digitizing offset show advanced.
static const QgsSettingsEntryInteger * settingsDigitizingOffsetQuadSeg
Settings entry digitizing offset quad seg.
static const QgsSettingsEntryEnumFlag< Qgis::EmbeddedScriptMode > * settingsCodeExecutionBehaviorUndeterminedProjects
Settings entry for behavior handling embedded scripts within projects.
static const QgsSettingsEntryString * settingsNetworkCacheDirectory
Settings entry network cache directory.
friend class QgsSettingsEntryBase
void setSelectedItem(const QString &item, const QStringList &parentsNamedItems=QStringList())
Sets the selected named item from the named list node.
QStringList items(const QStringList &parentsNamedItems=QStringList()) const
Returns the list of items.
QList< const QgsSettingsEntryBase * > childrenSettings() const
Returns the children settings.
static QgsSettingsTreeNode * sTreeDigitizing
static QgsSettingsTreeNode * sTreeWms
static QgsSettingsTreeNode * sTreeLayerTree
static QgsSettingsTreeNode * sTreeNetworkCache
static QgsSettingsTreeNode * sTreeGps
static QgsSettingsTreeNode * sTreeAttributeTable
static QgsSettingsTreeNode * sTreeMap
static QgsSettingsTreeNode * sTreeCore
QStringList childGroups(Qgis::SettingsOrigin origin=Qgis::SettingsOrigin::Any) const
Returns a list of all key top-level groups that contain keys that can be read using the QSettings obj...
void endGroup()
Resets the group to what it was before the corresponding beginGroup() call.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), Section section=NoSection) const
Returns the value for setting key.
bool contains(const QString &key, QgsSettings::Section section=QgsSettings::NoSection) const
Returns true if there exists a setting called key; returns false otherwise.
void beginGroup(const QString &prefix, QgsSettings::Section section=QgsSettings::NoSection)
Appends prefix to the current group.
static void releaseFlush()
Releases a previously made hold on flushing QgsSettings objects and writing new values to the underly...
static void holdFlush()
Temporarily places a hold on flushing QgsSettings objects and writing new values to the underlying in...
void remove(const QString &key, QgsSettings::Section section=QgsSettings::NoSection)
Removes the setting key and any sub-settings of key in a section.
static QgsSettingsProxy get()
Returns a proxy for a QgsSettings object.
static QgsSettingsTreeNamedListNode * sTreeXyzConnections
static const QgsSettingsEntryString * settingsPassword
static const QgsSettingsEntryDouble * settingsTilePixelRatio
static const QgsSettingsEntryString * settingsInterpretation
static const QgsSettingsEntryString * settingsUsername
static const QgsSettingsEntryString * settingsAuthcfg
static const QgsSettingsEntryInteger * settingsZmin
static const QgsSettingsEntryBool * settingsHidden
static const QgsSettingsEntryInteger * settingsZmax
static const QgsSettingsEntryString * settingsUrl
static const QgsSettingsEntryVariantMap * settingsHeaders
static const QgsSettingsEntryInteger * settingsRenderingLabelCandidatesLimitLines
Definition pal.h:96
static const QgsSettingsEntryInteger * settingsRenderingLabelCandidatesLimitPoints
Definition pal.h:95
static const QgsSettingsEntryInteger * settingsRenderingLabelCandidatesLimitPolygons
Definition pal.h:97
#define Q_NOWARN_DEPRECATED_POP
Definition qgis.h:7475
#define Q_NOWARN_DEPRECATED_PUSH
Definition qgis.h:7474