QGIS API Documentation 4.3.0-Master (16eddb2670e)
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"
19#include "qgsapplication.h"
20#include "qgsauthmanager.h"
22#include "qgscolorscheme.h"
25#include "qgscptcityarchive.h"
26#include "qgsdirectoryitem.h"
28#include "qgsgpsdetector.h"
29#include "qgsimagecache.h"
31#include "qgslayout.h"
33#include "qgslayoutsnapper.h"
34#include "qgslocator.h"
36#include "qgsnewsfeedparser.h"
37#include "qgsogrdbconnection.h"
38#include "qgsogrproviderutils.h"
39#include "qgsowsconnection.h"
40#include "qgsprocessing.h"
41#include "qgsproject.h"
42#include "qgsrasterlayer.h"
45#include "qgssettings.h"
48#include "qgssettingsproxy.h"
49#include "qgsvectorfilewriter.h"
50#include "qgsvectorlayer.h"
52
53#include <QString>
54
55#ifdef HAVE_OPENCL
56#include "qgsopenclutils.h"
57#endif
58
59#include <QSettings>
60#include <QThread>
61
62using namespace Qt::StringLiterals;
63
66
69
72
75
78
81
83
85
87
89
91
93
95
97
99
101
104
106
108
110
112
114
116
118
120
121
123 = new QgsSettingsEntryBool( u"disable-enter-attribute-values-dialog"_s, QgsSettingsTree::sTreeDigitizing, false );
124
126
128
130
132
134 = new QgsSettingsEntryDouble( u"convert-to-curve-angle-tolerance"_s, QgsSettingsTree::sTreeDigitizing, 1e-6 );
135
137 = new QgsSettingsEntryDouble( u"convert-to-curve-distance-tolerance"_s, QgsSettingsTree::sTreeDigitizing, 1e-6 );
138
140
142
144 Qgis::CadMeasurementDisplayType>( u"status-bar-area-display"_s, QgsSettingsTree::sTreeDigitizing, Qgis::CadMeasurementDisplayType::Hidden, u"Area measurement to show in status bar while digitizing"_s );
145
147 Qgis::CadMeasurementDisplayType>( u"status-bar-total-length-display"_s, QgsSettingsTree::sTreeDigitizing, Qgis::CadMeasurementDisplayType::Hidden, u"Total length/perimeter measurement to show in status bar while digitizing"_s );
148
150
152 = 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 );
153
155 = new QgsSettingsEntryBool( u"show-legend-classifiers"_s, QgsSettingsTree::sTreeLayerTree, false, u"If true, classification attribute name is shown in the legend."_s );
156
158 = new QgsSettingsEntryBool( u"show-id-in-layer-tooltips"_s, QgsSettingsTree::sTreeLayerTree, false, u"If true, layer IDs will be shown in the layer tooltips."_s );
159
161 = 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 );
162
164
166 = 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 );
167
169 = 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() );
170
172 = new QgsSettingsEntryString( u"directory"_s, QgsSettingsTree::sTreeNetworkCache, QString(), u"Network disk cache directory"_s );
173
175 = new QgsSettingsEntryInteger64( u"size-bytes"_s, QgsSettingsTree::sTreeNetworkCache, 0, u"Network disk cache size in bytes (0 = automatic size)"_s );
176
178 Qgis::EmbeddedScriptMode>( u"code-execution-behavior-undetermined-projects"_s, QgsSettingsTree::sTreeCore, Qgis::EmbeddedScriptMode::Ask, u"Behavior for embedded scripts within projects of undetermined trust"_s );
179
181 = 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 );
182
184 = 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 );
185
187 = new QgsSettingsEntryBool( u"planimetric"_s, QgsSettingsTree::sTreeMeasure, false, u"Whether measurements should be planimetric (ellipsoid off) or use the ellipsoid"_s );
188
190 = new QgsSettingsEntryBool( u"keep-base-unit"_s, QgsSettingsTree::sTreeMeasure, true, u"Whether to keep base measurement units instead of converting to larger units"_s );
191
193 = new QgsSettingsEntryInteger( u"decimal-places"_s, QgsSettingsTree::sTreeMeasure, 3, u"Number of decimal places for measurements"_s );
194
196 = new QgsSettingsEntryString( u"display-units"_s, QgsSettingsTree::sTreeMeasure, QString(), u"Distance display units (encoded unit string)"_s );
197
199 = new QgsSettingsEntryString( u"area-units"_s, QgsSettingsTree::sTreeMeasure, QString(), u"Area display units (encoded unit string)"_s );
200
202 Qgis::UnknownLayerCrsBehavior>( u"unknown-crs-behavior"_s, QgsSettingsTree::sTreeCrs, Qgis::UnknownLayerCrsBehavior::NoAction, u"Behavior when encountering a layer with an unknown CRS"_s );
203
205 = new QgsSettingsEntryString( u"layer-default-crs"_s, QgsSettingsTree::sTreeCrs, u"EPSG:4326"_s, u"Default CRS used for layers with unknown CRS when the unknown CRS behavior is set to UseDefaultCrs"_s );
206
208 Qgis::LayerTreeInsertionMethod>( u"insertion-method"_s, QgsSettingsTree::sTreeLayerTree, Qgis::LayerTreeInsertionMethod::AboveInsertionPoint, u"Method for inserting layers into the layer tree"_s );
209
211 = new QgsSettingsEntryString( u"scan-zip-in-browser"_s, QgsSettingsTree::sTreeQgis, u"basic"_s, u"Zip scanning behavior in browser (no, basic, full)"_s );
212
214 = new QgsSettingsEntryStringList( u"scan-items-fast-scan-uris"_s, QgsSettingsTree::sTreeQgis, QStringList(), u"URIs for fast scanning in browser"_s );
215
217 = new QgsSettingsEntryInteger( u"symbols-list-groups-index"_s, QgsSettingsTree::sTreeQgis, 0, u"Currently selected group index in symbols list"_s );
218
220 = new QgsSettingsEntryColor( u"default-canvas-color"_s, QgsSettingsTree::sTreeQgis, QColor( 255, 255, 255 ), u"Default canvas background color"_s );
221
223 = new QgsSettingsEntryColor( u"default-selection-color"_s, QgsSettingsTree::sTreeQgis, QColor( 255, 255, 0, 255 ), u"Default selection color"_s );
224
228
231
232void QgsSettingsRegistryCore::migrateOldSettings()
233{
234 // copy values from old keys to new keys and delete the old ones
235 // for backward compatibility, old keys are recreated when the registry gets deleted
236
237 // TODO: remove in QGIS 4.4 (after LTR 4.2)
238
239 // single settings - added in 3.30
240 QgsLayout::settingsSearchPathForTemplates->copyValueFromKey( u"core/Layout/searchPathsForTemplates"_s, true );
241 QgsLayout::settingsLayoutDefaultFont->copyValueFromKey( u"gui/LayoutDesigner/defaultFont"_s, true );
242 QgsLayout::settingsLayoutDefaultNorthArrow->copyValueFromKey( u"gui/LayoutDesigner/defaultNorthArrow"_s, true );
243
244 QgsProcessing::settingsPreferFilenameAsLayerName->copyValueFromKey( u"Processing/Configuration/PREFER_FILENAME_AS_LAYER_NAME"_s, true );
245 QgsProcessing::settingsTempPath->copyValueFromKey( u"Processing/Configuration/TEMP_PATH2"_s, true );
246
247 QgsNetworkAccessManager::settingsNetworkTimeout->copyValueFromKey( u"qgis/networkAndProxy/networkTimeout"_s, true );
248 QgsNetworkAccessManager::settingsUserAgent->copyValueFromKey( u"qgis/networkAndProxy/userAgent"_s, true );
249 QgsNetworkAccessManager::settingsUserAgent->copyValueFromKey( u"/qgis/networkAndProxy/userAgent"_s, true );
250
251 settingsLayerTreeShowFeatureCountForNewLayers->copyValueFromKey( u"core/layer-tree/show_feature_count_for_new_layers"_s, true );
252 settingsLayerTreeShowLegendClassifiers->copyValueFromKey( u"qgis/showLegendClassifiers"_s, true );
253 settingsLayerTreeShowLegendClassifiers->copyValueFromKey( u"/qgis/showLegendClassifiers"_s, true );
254
255 // single settings - added in 4.2
256 // Old code used QgsSettings::Core section, so the actual QSettings key has a "core/" prefix
257 settingsMeasurePlanimetric->copyValueFromKey( u"core/measure/planimetric"_s, true );
258 settingsMeasureKeepBaseUnit->copyValueFromKey( u"qgis/measure/keepbaseunit"_s, true );
259 settingsMeasureKeepBaseUnit->copyValueFromKey( u"/qgis/measure/keepbaseunit"_s, true );
260 settingsMeasureDecimalPlaces->copyValueFromKey( u"qgis/measure/decimalplaces"_s, true );
261 settingsMeasureDecimalPlaces->copyValueFromKey( u"/qgis/measure/decimalplaces"_s, true );
262 settingsMeasureDisplayUnits->copyValueFromKey( u"qgis/measure/displayunits"_s, true );
263 settingsMeasureDisplayUnits->copyValueFromKey( u"/qgis/measure/displayunits"_s, true );
264 settingsMeasureAreaUnits->copyValueFromKey( u"qgis/measure/areaunits"_s, true );
265 settingsMeasureAreaUnits->copyValueFromKey( u"/qgis/measure/areaunits"_s, true );
266 settingsLayerTreeInsertionMethod->copyValueFromKey( u"qgis/layerTreeInsertionMethod"_s, true );
267 settingsLayerTreeInsertionMethod->copyValueFromKey( u"/qgis/layerTreeInsertionMethod"_s, true );
268 settingsScanZipInBrowser->copyValueFromKey( u"qgis/scanZipInBrowser2"_s, true );
269 settingsScanZipInBrowser->copyValueFromKey( u"/qgis/scanZipInBrowser2"_s, true );
270 QgsProject::settingsAnonymizeNewProjects->copyValueFromKey( u"core/projects/anonymize_new_projects"_s, true );
271 QgsProject::settingsAnonymizeSavedProjects->copyValueFromKey( u"core/projects/anonymize_saved_projects"_s, true );
272 QgsProject::settingsDefaultProjectPathsRelative->copyValueFromKey( u"qgis/defaultProjectPathsRelative"_s, true );
273 QgsProject::settingsDefaultProjectPathsRelative->copyValueFromKey( u"/qgis/defaultProjectPathsRelative"_s, true );
274 // old key was stored under QgsSettings::App, i.e. "app/projections/unknownCrsBehavior"
275 settingsUnknownCrsBehavior->copyValueFromKey( u"app/projections/unknownCrsBehavior"_s, true );
276 settingsLayerDefaultCrs->copyValueFromKey( u"Projections/layerDefaultCrs"_s, true );
277 settingsLayerDefaultCrs->copyValueFromKey( u"/Projections/layerDefaultCrs"_s, true );
278 QgsApplication::settingsApplicationFullName->copyValueFromKey( u"qgis/application_full_name"_s, true );
279 QgsApplication::settingsApplicationFullName->copyValueFromKey( u"/qgis/application_full_name"_s, true );
280
281 // project templates now have a list of directories
282 QgsApplication::settingsProjectTemplatePaths->copyValueFromKey( u"qgis/projectTemplateDir"_s, true );
283 QgsApplication::settingsProjectTemplatePaths->copyValueFromKey( u"/qgis/projectTemplateDir"_s, true );
284
285 // gdal/skipDrivers was a comma-joined string; convert to a proper QStringList
286 {
287 QgsSettings s;
288 if ( s.contains( u"gdal/skipDrivers"_s ) )
289 {
290 const QString joined = s.value( u"gdal/skipDrivers"_s ).toString();
291 QgsApplication::settingsSkippedGdalDrivers->setValue( joined.isEmpty() ? QStringList() : joined.split( ','_L1 ) );
292 s.remove( u"gdal/skipDrivers"_s );
293 }
294 }
295
296 QgsDirectoryParamWidget::settingsDirectoryHiddenColumns->copyValueFromKey( u"dataitem/directoryHiddenColumns"_s, true );
297 QgsDirectoryParamWidget::settingsDirectoryHiddenColumns->copyValueFromKey( u"/dataitem/directoryHiddenColumns"_s, true );
298 QgsDirectoryItem::settingsMonitorDirectoriesInBrowser->copyValueFromKey( u"qgis/monitorDirectoriesInBrowser"_s, true );
299 QgsDirectoryItem::settingsMonitorDirectoriesInBrowser->copyValueFromKey( u"/qgis/monitorDirectoriesInBrowser"_s, true );
300 QgsFileBasedDataItemProvider::settingsScanItemsInBrowser->copyValueFromKey( u"qgis/scanItemsInBrowser2"_s, {}, true );
301 QgsFileBasedDataItemProvider::settingsScanItemsInBrowser->copyValueFromKey( u"/qgis/scanItemsInBrowser2"_s, {}, true );
302 settingsScanItemsFastScanUris->copyValueFromKey( u"qgis/scanItemsFastScanUris"_s, true );
303 settingsScanItemsFastScanUris->copyValueFromKey( u"/qgis/scanItemsFastScanUris"_s, true );
304 settingsSymbolsListGroupsIndex->copyValueFromKey( u"qgis/symbolsListGroupsIndex"_s, true );
305 settingsSymbolsListGroupsIndex->copyValueFromKey( u"/qgis/symbolsListGroupsIndex"_s, true );
306 settingsDefaultCanvasColor->copyValueFromKeys( u"qgis/default_canvas_color_red"_s, u"qgis/default_canvas_color_green"_s, u"qgis/default_canvas_color_blue"_s, QString(), true );
307 settingsDefaultCanvasColor->copyValueFromKeys( u"/qgis/default_canvas_color_red"_s, u"/qgis/default_canvas_color_green"_s, u"/qgis/default_canvas_color_blue"_s, QString(), true );
309 ->copyValueFromKeys( u"qgis/default_selection_color_red"_s, u"qgis/default_selection_color_green"_s, u"qgis/default_selection_color_blue"_s, u"qgis/default_selection_color_alpha"_s, true );
311 ->copyValueFromKeys( u"/qgis/default_selection_color_red"_s, u"/qgis/default_selection_color_green"_s, u"/qgis/default_selection_color_blue"_s, u"/qgis/default_selection_color_alpha"_s, true );
312
313#if defined( HAVE_QTSERIALPORT )
314 QgsGpsDetector::settingsGpsStopBits->copyValueFromKey( u"core/gps/stop_bits"_s, true );
315 QgsGpsDetector::settingsGpsFlowControl->copyValueFromKey( u"core/gps/flow_control"_s, true );
316 QgsGpsDetector::settingsGpsDataBits->copyValueFromKey( u"core/gps/data_bits"_s, true );
317 QgsGpsDetector::settingsGpsParity->copyValueFromKey( u"core/gps/parity"_s, true );
318#endif
319
320 QgsRasterLayer::settingsRasterDefaultOversampling->copyValueFromKey( u"Raster/defaultOversampling"_s, true );
321 QgsRasterLayer::settingsRasterDefaultEarlyResampling->copyValueFromKey( u"Raster/defaultEarlyResampling"_s, true );
322 QgsRasterLayer::settingsRasterDefaultZoomedInResampling->copyValueFromKey( u"Raster/defaultZoomedInResampling"_s, true );
323 QgsRasterLayer::settingsRasterDefaultZoomedInResampling->copyValueFromKey( u"/Raster/defaultZoomedInResampling"_s, true );
324 QgsRasterLayer::settingsRasterDefaultZoomedOutResampling->copyValueFromKey( u"Raster/defaultZoomedOutResampling"_s, true );
325 QgsRasterLayer::settingsRasterDefaultZoomedOutResampling->copyValueFromKey( u"/Raster/defaultZoomedOutResampling"_s, true );
326 for ( const QString &rendererKey : { u"singleBand"_s, u"multiBandSingleByte"_s, u"multiBandMultiByte"_s } )
327 {
328 QgsRasterLayer::settingsRasterDefaultContrastEnhancementAlgorithm->copyValueFromKey( u"Raster/defaultContrastEnhancementAlgorithm/%1"_s, { rendererKey }, true );
329 QgsRasterLayer::settingsRasterDefaultContrastEnhancementLimits->copyValueFromKey( u"Raster/defaultContrastEnhancementLimits/%1"_s, { rendererKey }, true );
330 }
331 // No copyValueFromKey for settingsFavoriteDirs: old key "browser/favourites" is identical to new key path
332 QgsNetworkAccessManager::settingsProxyEnabled->copyValueFromKey( u"proxy/proxyEnabled"_s, true );
336 QgsNetworkAccessManager::settingsProxyPassword->copyValueFromKey( u"proxy/proxyPassword"_s, true );
338 QgsNetworkAccessManager::settingsProxyExcludedUrls->copyValueFromKey( u"proxy/proxyExcludedUrls"_s, true );
339 QgsNetworkAccessManager::settingsNoProxyUrls->copyValueFromKey( u"proxy/noProxyUrls"_s, true );
342 QgsImageCache::settingsMaxImageCacheSize->copyValueFromKey( u"qgis/maxImageCacheSize"_s, true );
343 QgsSymbolLegendNode::settingsLegendSymbolMinimumSize->copyValueFromKey( u"qgis/legendsymbolMinimumSize"_s, true );
344 QgsSymbolLegendNode::settingsLegendSymbolMaximumSize->copyValueFromKey( u"qgis/legendsymbolMaximumSize"_s, true );
345#ifdef HAVE_OPENCL
346 QgsOpenClUtils::settingsOpenClEnabled->copyValueFromKey( u"core/OpenClEnabled"_s, true );
347 QgsOpenClUtils::settingsOpenClDefaultDevice->copyValueFromKey( u"core/OpenClDefaultDevice"_s, true );
348#endif
349 QgsOgrProviderUtils::settingsWalForSqlite3->copyValueFromKey( u"qgis/walForSqlite3"_s, true );
350
351 QgsLayoutGridSettings::settingsGridStyle->copyValueFromKey( u"gui/LayoutDesigner/gridStyle"_s, true );
352 QgsLayoutGridSettings::settingsGridColor->copyValueFromKeys( u"gui/LayoutDesigner/gridRed"_s, u"gui/LayoutDesigner/gridGreen"_s, u"gui/LayoutDesigner/gridBlue"_s, u"gui/LayoutDesigner/gridAlpha"_s, true );
353 QgsLayoutGridSettings::settingsGridResolution->copyValueFromKey( u"gui/LayoutDesigner/defaultSnapGridResolution"_s, true );
354 QgsLayoutGridSettings::settingsGridOffsetX->copyValueFromKey( u"gui/LayoutDesigner/defaultSnapGridOffsetX"_s, true );
355 QgsLayoutGridSettings::settingsGridOffsetY->copyValueFromKey( u"gui/LayoutDesigner/defaultSnapGridOffsetY"_s, true );
356 QgsLayoutSnapper::settingsSnapTolerance->copyValueFromKey( u"gui/LayoutDesigner/defaultSnapTolerancePixels"_s, true );
357
358 QgsRasterRendererRegistry::settingsDefaultRedBand->copyValueFromKey( u"Raster/defaultRedBand"_s, true );
359 QgsRasterRendererRegistry::settingsDefaultGreenBand->copyValueFromKey( u"Raster/defaultGreenBand"_s, true );
360 QgsRasterRendererRegistry::settingsDefaultBlueBand->copyValueFromKey( u"Raster/defaultBlueBand"_s, true );
361 QgsRasterRendererRegistry::settingsUseStandardDeviation->copyValueFromKey( u"Raster/useStandardDeviation"_s, true );
362 QgsRasterRendererRegistry::settingsDefaultStandardDeviation->copyValueFromKey( u"Raster/defaultStandardDeviation"_s, true );
363
364 pal::Pal::settingsRenderingLabelCandidatesLimitPoints->copyValueFromKey( u"core/rendering/label_candidates_limit_points"_s, true );
365 pal::Pal::settingsRenderingLabelCandidatesLimitLines->copyValueFromKey( u"core/rendering/label_candidates_limit_lines"_s, true );
366 pal::Pal::settingsRenderingLabelCandidatesLimitPolygons->copyValueFromKey( u"core/rendering/label_candidates_limit_polygons"_s, true );
367
368 QgsCustomColorScheme::settingsPaletteColors->copyValueFromKey( u"colors/palettecolors"_s, {}, true );
369 QgsCustomColorScheme::settingsPaletteLabels->copyValueFromKey( u"colors/palettelabels"_s, {}, true );
370 QgsUserColorScheme::settingsShowInMenuList->copyValueFromKey( u"colors/showInMenuList"_s, {}, true );
371
372 // digitizing settings - added in 3.30
373 {
374 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, true );
375 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, true );
376
377 const QList<const QgsSettingsEntryBase *> settings = QgsSettingsTree::sTreeDigitizing->childrenSettings();
378 for ( const QgsSettingsEntryBase *setting : settings )
379 {
380 QString name = setting->name();
381 if ( name == settingsDigitizingStreamTolerance->name() || name == settingsDigitizingLineColor->name() || name == settingsDigitizingFillColor->name() )
382 continue;
383 if ( name == settingsDigitizingReuseLastValues->name() )
384 {
385 name = u"reuseLastValues"_s;
386 }
387 else
388 {
389 name.replace( '-', '_' );
390 }
391 setting->copyValueFromKey( QString( "qgis/digitizing/%1" ).arg( name ), true );
392 }
393 }
394
395 // locator filters - added in 3.30
396 {
397 QSettings &locatorSettings = QgsSettingsEntryBase::userSettings();
398 locatorSettings.beginGroup( u"gui/locator_filters"_s );
399 const QStringList childKeys = locatorSettings.childKeys();
400 locatorSettings.endGroup();
401 for ( const QString &childKey : childKeys )
402 {
403 if ( childKey.startsWith( "enabled"_L1 ) )
404 {
405 QString filter = childKey;
406 filter.remove( u"enabled_"_s );
407 QgsLocator::settingsLocatorFilterEnabled->copyValueFromKey( u"gui/locator_filters/enabled_%1"_s, { filter }, true );
408 QgsLocator::settingsLocatorFilterDefault->copyValueFromKey( u"gui/locator_filters/default_%1"_s, { filter }, true );
409 QgsLocator::settingsLocatorFilterPrefix->copyValueFromKey( u"gui/locator_filters/prefix_%1"_s, { filter }, true );
410 }
411 }
412 }
413
414 // connections settings - added in 3.30
415 const QStringList services = { u"WMS"_s, u"WFS"_s, u"WCS"_s };
416 for ( const QString &service : services )
417 {
418 QgsSettings settings;
419 settings.beginGroup( u"qgis/connections-%1"_s.arg( service.toLower() ) );
420 const QStringList connections = settings.childGroups();
421 if ( connections.count() == 0 )
422 continue;
423 for ( const QString &connection : connections )
424 {
425 if ( settings.value( u"%1/url"_s.arg( connection ) ).toString().isEmpty() )
426 continue;
427
428 QgsOwsConnection::settingsUrl->copyValueFromKey( u"qgis/connections-%1/%2/url"_s, { service.toLower(), connection }, true );
429 QgsOwsConnection::settingsVersion->copyValueFromKey( u"qgis/connections-%1/%2/version"_s, { service.toLower(), connection }, true );
430 QgsOwsConnection::settingsIgnoreGetMapURI->copyValueFromKey( u"qgis/connections-%1/%2/ignoreGetMapURI"_s, { service.toLower(), connection }, true );
431 QgsOwsConnection::settingsIgnoreGetFeatureInfoURI->copyValueFromKey( u"qgis/connections-%1/%2/ignoreGetFeatureInfoURI"_s, { service.toLower(), connection }, true );
432 QgsOwsConnection::settingsSmoothPixmapTransform->copyValueFromKey( u"qgis/connections-%1/%2/smoothPixmapTransform"_s, { service.toLower(), connection }, true );
433 QgsOwsConnection::settingsReportedLayerExtents->copyValueFromKey( u"qgis/connections-%1/%2/reportedLayerExtents"_s, { service.toLower(), connection }, true );
434 QgsOwsConnection::settingsDpiMode->copyValueFromKey( u"qgis/connections-%1/%2/dpiMode"_s, { service.toLower(), connection }, true );
435 QgsOwsConnection::settingsTilePixelRatio->copyValueFromKey( u"qgis/connections-%1/%2/tilePixelRatio"_s, { service.toLower(), connection }, true );
436 QgsOwsConnection::settingsMaxNumFeatures->copyValueFromKey( u"qgis/connections-%1/%2/maxnumfeatures"_s, { service.toLower(), connection }, true );
437 QgsOwsConnection::settingsPagesize->copyValueFromKey( u"qgis/connections-%1/%2/pagesize"_s, { service.toLower(), connection }, true );
438 QgsOwsConnection::settingsPagingEnabled->copyValueFromKey( u"qgis/connections-%1/%2/pagingenabled"_s, { service.toLower(), connection }, true );
439 QgsOwsConnection::settingsPreferCoordinatesForWfsT11->copyValueFromKey( u"qgis/connections-%1/%2/preferCoordinatesForWfsT11"_s, { service.toLower(), connection }, true );
440 QgsOwsConnection::settingsIgnoreAxisOrientation->copyValueFromKey( u"qgis/connections-%1/%2/ignoreAxisOrientation"_s, { service.toLower(), connection }, true );
441 QgsOwsConnection::settingsInvertAxisOrientation->copyValueFromKey( u"qgis/connections-%1/%2/invertAxisOrientation"_s, { service.toLower(), connection }, true );
442
444 settings.beginGroup( connection );
445 QgsOwsConnection::settingsHeaders->setValue( QgsHttpHeaders( settings ).headers(), { service.toLower(), connection } );
446 settings.remove( u"http-header"_s );
447 settings.endGroup();
449
450 QgsOwsConnection::settingsUsername->copyValueFromKey( u"qgis/connections/%1/%2/username"_s.arg( service, connection ), { service.toLower(), connection }, true );
451 QgsOwsConnection::settingsPassword->copyValueFromKey( u"qgis/connections/%1/%2/password"_s.arg( service, connection ), { service.toLower(), connection }, true );
452 QgsOwsConnection::settingsAuthCfg->copyValueFromKey( u"qgis/connections/%1/%2/authcfg"_s.arg( service, connection ), { service.toLower(), connection }, true );
453 }
454 if ( settings.contains( u"selected"_s ) )
455 QgsOwsConnection::sTreeOwsConnections->setSelectedItem( settings.value( u"selected"_s ).toString(), { service.toLower() } );
456 }
457
458 // Vector tile - added in 3.30
459 {
460 QgsSettings settings;
461 settings.beginGroup( u"qgis/connections-vector-tile"_s );
462 const QStringList connections = settings.childGroups();
463 for ( const QString &connection : connections )
464 {
465 if ( settings.value( u"%1/url"_s.arg( connection ) ).toString().isEmpty() )
466 continue;
467
468 QgsVectorTileProviderConnection::settingsUrl->copyValueFromKey( u"qgis/connections-vector-tile/%1/url"_s, { connection }, true );
469 QgsVectorTileProviderConnection::settingsZmin->copyValueFromKey( u"qgis/connections-vector-tile/%1/zmin"_s, { connection }, true );
470 QgsVectorTileProviderConnection::settingsZmax->copyValueFromKey( u"qgis/connections-vector-tile/%1/zmax"_s, { connection }, true );
471 QgsVectorTileProviderConnection::settingsAuthcfg->copyValueFromKey( u"qgis/connections-vector-tile/%1/authcfg"_s, { connection }, true );
472 QgsVectorTileProviderConnection::settingsUsername->copyValueFromKey( u"qgis/connections-vector-tile/%1/username"_s, { connection }, true );
473 QgsVectorTileProviderConnection::settingsPassword->copyValueFromKey( u"qgis/connections-vector-tile/%1/password"_s, { connection }, true );
474 QgsVectorTileProviderConnection::settingsStyleUrl->copyValueFromKey( u"qgis/connections-vector-tile/%1/styleUrl"_s, { connection }, true );
475 QgsVectorTileProviderConnection::settingsServiceType->copyValueFromKey( u"qgis/connections-vector-tile/%1/serviceType"_s, { connection }, true );
477 settings.beginGroup( connection );
478 QgsVectorTileProviderConnection::settingsHeaders->setValue( QgsHttpHeaders( settings ).headers(), connection );
479 settings.remove( u"http-header"_s );
480 settings.endGroup();
482 }
483 }
484
485 // xyz - added in 3.30
486 {
487 QgsSettings settings;
488 settings.beginGroup( u"qgis/connections-xyz"_s );
489 const QStringList connections = settings.childGroups();
490 for ( const QString &connection : connections )
491 {
492 if ( settings.value( u"%1/url"_s.arg( connection ) ).toString().isEmpty() )
493 continue;
494
495 QgsXyzConnectionSettings::settingsUrl->copyValueFromKey( u"qgis/connections-xyz/%1/url"_s, { connection }, true );
496 QgsXyzConnectionSettings::settingsZmin->copyValueFromKey( u"qgis/connections-xyz/%1/zmin"_s, { connection }, true );
497 QgsXyzConnectionSettings::settingsZmax->copyValueFromKey( u"qgis/connections-xyz/%1/zmax"_s, { connection }, true );
498 QgsXyzConnectionSettings::settingsAuthcfg->copyValueFromKey( u"qgis/connections-xyz/%1/authcfg"_s, { connection }, true );
499 QgsXyzConnectionSettings::settingsUsername->copyValueFromKey( u"qgis/connections-xyz/%1/username"_s, { connection }, true );
500 QgsXyzConnectionSettings::settingsPassword->copyValueFromKey( u"qgis/connections-xyz/%1/password"_s, { connection }, true );
501 QgsXyzConnectionSettings::settingsTilePixelRatio->copyValueFromKey( u"qgis/connections-xyz/%1/tilePixelRatio"_s, { connection }, true );
502 QgsXyzConnectionSettings::settingsHidden->copyValueFromKey( u"qgis/connections-xyz/%1/hidden"_s, { connection }, true );
503 QgsXyzConnectionSettings::settingsInterpretation->copyValueFromKey( u"qgis/connections-xyz/%1/interpretation"_s, { connection }, true );
505 settings.beginGroup( connection );
506 QgsXyzConnectionSettings::settingsHeaders->setValue( QgsHttpHeaders( settings ).headers(), connection );
507 settings.remove( u"http-header"_s );
508 settings.endGroup();
510 }
511 }
512
513 // arcgis - added in 3.30
514 {
515 // arcgismapserver entries are not used anymore (even in 3.28, only arcgisfeature server is used)
516 const QStringList serviceKeys = { u"qgis/connections-arcgisfeatureserver"_s, u"qgis/connections-arcgismapserver"_s };
517 QgsSettings settings;
518 for ( const QString &serviceKey : serviceKeys )
519 {
520 settings.beginGroup( serviceKey );
521 const QStringList connections = settings.childGroups();
522 for ( const QString &connection : connections )
523 {
524 QgsArcGisConnectionSettings::settingsUrl->copyValueFromKey( u"qgis/connections-arcgisfeatureserver/%1/url"_s, { connection }, true );
525 QgsArcGisConnectionSettings::settingsAuthcfg->copyValueFromKey( u"qgis/ARCGISFEATURESERVER/%1/authcfg"_s, { connection }, true );
526 QgsArcGisConnectionSettings::settingsUsername->copyValueFromKey( u"qgis/ARCGISFEATURESERVER/%1/username"_s, { connection }, true );
527 QgsArcGisConnectionSettings::settingsPassword->copyValueFromKey( u"qgis/ARCGISFEATURESERVER/%1/password"_s, { connection }, true );
528 QgsArcGisConnectionSettings::settingsContentEndpoint->copyValueFromKey( u"qgis/connections-arcgisfeatureserver/%1/content_endpoint"_s, { connection }, true );
529 QgsArcGisConnectionSettings::settingsCommunityEndpoint->copyValueFromKey( u"qgis/connections-arcgisfeatureserver/%1/community_endpoint"_s, { connection }, true );
531 settings.beginGroup( connection );
532 QgsArcGisConnectionSettings::settingsHeaders->setValue( QgsHttpHeaders( settings ).headers(), connection );
533 settings.remove( u"http-header"_s );
534 settings.endGroup();
536 }
537 settings.remove( serviceKey );
538 }
539 }
540
541 // babel devices settings - added in 3.30
542 {
543 if ( QgsBabelFormatRegistry::sTreeBabelDevices->items().count() == 0 )
544 {
545 const QStringList deviceNames = QgsSettingsEntryBase::userSettings().value( u"/Plugin-GPS/devices/deviceList"_s ).toStringList();
546
547 for ( const QString &device : deviceNames )
548 {
549 QgsBabelFormatRegistry::settingsBabelWptDownload->copyValueFromKey( u"/Plugin-GPS/devices/%1/wptdownload"_s, { device }, true );
550 QgsBabelFormatRegistry::settingsBabelWptUpload->copyValueFromKey( u"/Plugin-GPS/devices/%1/wptupload"_s, { device }, true );
551 QgsBabelFormatRegistry::settingsBabelRteDownload->copyValueFromKey( u"/Plugin-GPS/devices/%1/rtedownload"_s, { device }, true );
552 QgsBabelFormatRegistry::settingsBabelRteUpload->copyValueFromKey( u"/Plugin-GPS/devices/%1/rteupload"_s, { device }, true );
553 QgsBabelFormatRegistry::settingsBabelTrkDownload->copyValueFromKey( u"/Plugin-GPS/devices/%1/trkdownload"_s, { device }, true );
554 QgsBabelFormatRegistry::settingsBabelTrkUpload->copyValueFromKey( u"/Plugin-GPS/devices/%1/trkupload"_s, { device }, true );
555 }
556 }
557 }
558
559 // recent CRS
566
567 // auth settings
568 QgsAuthManager::settingsPasswordHelperInsecureFallback->copyValueFromKey( u"auth/password_helper_insecure_fallback"_s, {}, true );
569 QgsAuthManager::settingsUsePasswordHelper->copyValueFromKey( u"auth/use_password_helper"_s, {}, true );
570 QgsAuthManager::settingsPasswordHelperLogging->copyValueFromKey( u"auth/password_helper_logging"_s, {}, true );
571
572 // raster cumulative cut
573 QgsRasterMinMaxOrigin::settingsCumulativeCutLower->copyValueFromKey( u"Raster/cumulativeCutLower"_s, {}, true );
574 QgsRasterMinMaxOrigin::settingsCumulativeCutLower->copyValueFromKey( u"raster/cumulativeCutLower"_s, {}, true );
575 QgsRasterMinMaxOrigin::settingsCumulativeCutUpper->copyValueFromKey( u"Raster/cumulativeCutUpper"_s, {}, true );
576 QgsRasterMinMaxOrigin::settingsCumulativeCutUpper->copyValueFromKey( u"raster/cumulativeCutUpper"_s, {}, true );
577
578 // CptCity
579 QgsCptCityArchive::settingsCptCityBaseDir->copyValueFromKey( u"CptCity/baseDir"_s, {}, true );
580 QgsCptCityArchive::settingsCptCityBaseDir->copyValueFromKey( u"core/cptcity-base-dir"_s, {}, true );
581 QgsCptCityArchive::settingsCptCityArchiveName->copyValueFromKey( u"CptCity/archiveName"_s, {}, true );
582 QgsCptCityArchive::settingsCptCityArchiveName->copyValueFromKey( u"core/cptcity-archive-name"_s, {}, true );
583
584 // encoding
586
587 // browser custom directory colors - dynamic per-path key
588 {
589 auto settings = QgsSettings::get();
590 settings->beginGroup( u"qgis/browserPathColors"_s );
591 const QStringList keys = settings->childKeys();
592 for ( const QString &mangledPath : keys )
593 {
594 QgsDirectoryItem::settingsCustomPathColor->setValue( settings->value( mangledPath ).toString(), { mangledPath } );
595 }
596 settings->endGroup();
597 settings->remove( u"qgis/browserPathColors"_s );
598 }
599
600 // news feed disabled state - dynamic per-feed key
601 {
602 auto settings = QgsSettings::get();
603 settings->beginGroup( u"core/NewsFeed"_s );
604 const QStringList feedKeys = settings->childGroups();
605 for ( const QString &feedKey : feedKeys )
606 {
607 const QString disabledKey = feedKey + "/disabled"_L1;
608 if ( settings->contains( disabledKey ) )
609 {
610 QgsNewsFeedParser::settingsFeedDisabled->setValue( settings->value( disabledKey ).toBool(), { feedKey } );
611 settings->remove( disabledKey );
612 }
613 }
614 settings->endGroup();
615 }
616
617 // application custom variables - dynamic per-variable name key
618 {
619 auto settings = QgsSettings::get();
620 settings->beginGroup( u"variables"_s );
621 const QStringList keys = settings->childKeys();
622 for ( const QString &name : keys )
623 {
624 QgsApplication::settingsCustomVariable->setValue( settings->value( name ), { name } );
625 }
626 settings->endGroup();
627 settings->remove( u"variables"_s );
628 }
629
630 // processing default GUI parameter values - dynamic per-algorithm-id and per-parameter-name key
631 {
632 auto settings = QgsSettings::get();
633 settings->beginGroup( u"Processing/DefaultGuiParam"_s );
634 const QStringList algIds = settings->childGroups();
635 for ( const QString &algId : algIds )
636 {
637 settings->beginGroup( algId );
638 const QStringList paramNames = settings->childKeys();
639 for ( const QString &paramName : paramNames )
640 {
641 QgsProcessing::settingsDefaultGuiParam->setValue( settings->value( paramName ), { algId, paramName } );
642 }
643 settings->endGroup();
644 }
645 settings->endGroup();
646 settings->remove( u"Processing/DefaultGuiParam"_s );
647 }
648
649 // coordinate transform context - per source/destination CRS pair
650 // old keys: Projections/<srcAuthId>//<destAuthId>_coordinateOp and _allowFallback
651 {
652 auto settings = QgsSettings::get();
653 settings->beginGroup( u"Projections"_s );
654 const QStringList projectionKeys = settings->allKeys();
655 for ( const QString &key : projectionKeys )
656 {
657 if ( !key.contains( "coordinateOp"_L1 ) )
658 continue;
659 const QStringList split = key.split( '/' );
660 if ( split.size() < 2 )
661 continue;
662 const QString srcAuthId = split.at( 0 );
663 const QString destAuthId = split.at( 1 ).split( '_' ).at( 0 );
664 if ( srcAuthId.isEmpty() || destAuthId.isEmpty() )
665 continue;
666
667 const QString proj = settings->value( key ).toString();
668 const QString fallbackKey = u"%1//%2_allowFallback"_s.arg( srcAuthId, destAuthId );
669 const bool allowFallback = settings->value( fallbackKey ).toBool();
671 QgsCoordinateTransformContext::settingsAllowFallback->setValue( allowFallback, { srcAuthId, destAuthId } );
672 }
673 // remove all legacy entries
674 for ( const QString &key : projectionKeys )
675 {
676 if ( key.contains( "srcTransform"_L1 ) || key.contains( "destTransform"_L1 ) || key.contains( "coordinateOp"_L1 ) || key.contains( "allowFallback"_L1 ) )
677 {
678 settings->remove( key );
679 }
680 }
681 settings->endGroup();
682 }
683
684 // OGR DB connections (GeoPackage, SpatiaLite) - dynamic per-driver and per-connection key
685 // old keys: providers/ogr/<driver>/connections/<conn>/path and providers/ogr/<driver>/connections/selected
686 {
687 auto settings = QgsSettings::get();
688 settings->beginGroup( u"ogr"_s, QgsSettings::Section::Providers );
689 const QStringList drivers = settings->childGroups();
690 for ( const QString &driver : drivers )
691 {
692 settings->beginGroup( driver );
693 settings->beginGroup( u"connections"_s );
694 const QStringList connNames = settings->childGroups();
695 for ( const QString &connName : connNames )
696 {
697 const QString path = settings->value( u"%1/path"_s.arg( connName ) ).toString();
698 if ( !path.isEmpty() )
699 QgsOgrDbConnection::settingsOgrConnectionPath->setValue( path, { driver, connName } );
700 }
701 const QString selected = settings->value( u"selected"_s ).toString();
702 if ( !selected.isEmpty() )
703 QgsOgrDbConnection::sTreeOgrConnectionItems->setSelectedItem( selected, { driver } );
704 settings->endGroup(); // connections
705 settings->endGroup(); // driver
706 }
707 settings->endGroup(); // ogr
708 settings->remove( u"ogr"_s, QgsSettings::Section::Providers );
709 }
710}
711
712void QgsSettingsRegistryCore::backwardCompatibility()
713{}
SettingsOption
Settings options.
Definition qgis.h:785
static const Qgis::MapToolUnit DEFAULT_SNAP_UNITS
Default snapping distance units.
Definition qgis.h:7348
@ Pixels
Pixels unit of tolerance.
Definition qgis.h:5538
static const double DEFAULT_Z_COORDINATE
Default Z coordinate value.
Definition qgis.h:7325
@ Vertex
On vertices.
Definition qgis.h:812
LayerTreeInsertionMethod
Layer tree insertion methods.
Definition qgis.h:5022
@ AboveInsertionPoint
Layers are added in the tree above the insertion point.
Definition qgis.h:5023
static const double DEFAULT_SNAP_TOLERANCE
Default snapping distance tolerance.
Definition qgis.h:7343
static const double DEFAULT_M_COORDINATE
Default M coordinate value.
Definition qgis.h:7332
static QString defaultProjectScales()
A string with default project scales.
Definition qgis.cpp:674
@ Round
Use rounded joins.
Definition qgis.h:2294
CadMeasurementDisplayType
Advanced digitizing measurement display types.
Definition qgis.h:4353
@ Hidden
Hide measurement.
Definition qgis.h:4354
@ Round
Round cap.
Definition qgis.h:2281
UnknownLayerCrsBehavior
Behavior to use when encountering a layer with an unknown (invalid) CRS.
Definition qgis.h:2644
@ NoAction
Take no action and leave as unknown CRS.
Definition qgis.h:2645
EmbeddedScriptMode
Authorisation to run script embedded in projects.
Definition qgis.h:468
@ Ask
User is prompted before running scripts.
Definition qgis.h:470
@ AllLayers
On all vector layers.
Definition qgis.h:800
static const QgsSettingsEntryString * settingsApplicationFullName
static const QgsSettingsEntryString * settingsNullRepresentation
static const QgsSettingsEntryStringList * settingsProjectTemplatePaths
Settings entry search path for project templates.
static const QgsSettingsEntryStringList * settingsSkippedGdalDrivers
static const QgsSettingsEntryVariant * settingsCustomVariable
static const QgsSettingsEntryString * settingsUsername
static const QgsSettingsEntryString * settingsUrl
static const QgsSettingsEntryString * settingsPassword
static const QgsSettingsEntryVariantMap * settingsHeaders
static const QgsSettingsEntryString * settingsContentEndpoint
static const QgsSettingsEntryString * settingsAuthcfg
static const QgsSettingsEntryString * settingsCommunityEndpoint
static const QgsSettingsEntryBool * settingsPasswordHelperInsecureFallback
static const QgsSettingsEntryBool * settingsPasswordHelperLogging
static const QgsSettingsEntryBool * settingsUsePasswordHelper
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 * settingsRecentProjectionsProj4
static const QgsSettingsEntryStringList * settingsRecentProjectionsWkt
static const QgsSettingsEntryStringList * settingsRecentProjectionsAuthId
static const QgsSettingsEntryString * settingsCoordinateOperation
static const QgsSettingsEntryBool * settingsAllowFallback
static const QgsSettingsEntryString * settingsCptCityArchiveName
static const QgsSettingsEntryString * settingsCptCityBaseDir
static const QgsSettingsEntryVariant * settingsPaletteLabels
static const QgsSettingsEntryVariant * settingsPaletteColors
static const QgsSettingsEntryString * settingsCustomPathColor
static const QgsSettingsEntryBool * settingsMonitorDirectoriesInBrowser
static const QgsSettingsEntryVariant * settingsDirectoryHiddenColumns
static const QgsSettingsEntryString * settingsScanItemsInBrowser
static const QgsSettingsEntryInteger * settingsMaxImageCacheSize
static const QgsSettingsEntryDouble * settingsGridOffsetX
static const QgsSettingsEntryColor * settingsGridColor
static const QgsSettingsEntryDouble * settingsGridResolution
static const QgsSettingsEntryDouble * settingsGridOffsetY
static const QgsSettingsEntryString * settingsGridStyle
static const QgsSettingsEntryInteger * settingsSnapTolerance
static const QgsSettingsEntryString * settingsLayoutDefaultNorthArrow
Settings entry for the default north arrow SVG path.
Definition qgslayout.h:674
static const QgsSettingsEntryStringList * settingsSearchPathForTemplates
Settings entry search path for templates.
Definition qgslayout.h:662
static const QgsSettingsEntryString * settingsLayoutDefaultFont
Settings entry for the default font family used for new layout items.
Definition qgslayout.h:668
static const QgsSettingsEntryBool * settingsLocatorFilterDefault
Settings entry locator filter default value.
Definition qgslocator.h:167
static const QgsSettingsEntryBool * settingsLocatorFilterEnabled
Settings entry locator filter enabled.
Definition qgslocator.h:165
static const QgsSettingsEntryString * settingsLocatorFilterPrefix
Settings entry locator filter prefix.
Definition qgslocator.h:169
static const QgsSettingsEntryString * settingsProxyAuthCfg
Settings entry for proxy authentication configuration.
static const QgsSettingsEntryInteger * settingsNetworkTimeout
Settings entry network timeout.
static const QgsSettingsEntryString * settingsProxyUser
Settings entry for proxy user.
static const QgsSettingsEntryString * settingsProxyHost
Settings entry for proxy host.
static const QgsSettingsEntryString * settingsProxyPort
Settings entry for proxy port.
static const QgsSettingsEntryString * settingsProxyExcludedUrls
Settings entry for proxy excluded URLs (legacy, falls back to system proxy for these).
static const QgsSettingsEntryString * settingsUserAgent
Settings entry for user agent string.
static const QgsSettingsEntryBool * settingsProxyEnabled
Settings entry for whether proxy is enabled.
static const QgsSettingsEntryString * settingsProxyPassword
Settings entry for proxy password.
static const QgsSettingsEntryStringList * settingsNoProxyUrls
Settings entry for no-proxy URLs.
static const QgsSettingsEntryString * settingsProxyType
Settings entry for proxy type.
static const QgsSettingsEntryBool * settingsFeedDisabled
static const QgsSettingsEntryBool * settingsOpenClEnabled
static const QgsSettingsEntryString * settingsOpenClDefaultDevice
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 QgsSettingsEntryVariant * settingsDefaultGuiParam
Settings entry default GUI parameter value (per algorithm id and parameter name).
static const QgsSettingsEntryBool * settingsAnonymizeSavedProjects
Definition qgsproject.h:140
static const QgsSettingsEntryBool * settingsAnonymizeNewProjects
Definition qgsproject.h:139
static const QgsSettingsEntryBool * settingsDefaultProjectPathsRelative
Definition qgsproject.h:141
static const QgsSettingsEntryString * settingsRasterDefaultContrastEnhancementLimits
static const QgsSettingsEntryBool * settingsRasterDefaultEarlyResampling
static const QgsSettingsEntryString * settingsRasterDefaultContrastEnhancementAlgorithm
static const QgsSettingsEntryDouble * settingsRasterDefaultOversampling
static const QgsSettingsEntryString * settingsRasterDefaultZoomedInResampling
static const QgsSettingsEntryString * settingsRasterDefaultZoomedOutResampling
static const QgsSettingsEntryDouble * settingsCumulativeCutUpper
static const QgsSettingsEntryDouble * settingsCumulativeCutLower
static const QgsSettingsEntryInteger * settingsDefaultGreenBand
static const QgsSettingsEntryBool * settingsUseStandardDeviation
static const QgsSettingsEntryDouble * settingsDefaultStandardDeviation
static const QgsSettingsEntryInteger * settingsDefaultRedBand
static const QgsSettingsEntryInteger * settingsDefaultBlueBand
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.
static QSettings & userSettings()
Returns a reference to the thread-local QSettings instance used internally by all QgsSettingsEntry op...
A boolean settings entry.
A color settings entry.
bool copyValueFromKeys(const QString &redKey, const QString &greenKey, const QString &blueKey, const QString &alphaKey=QString(), bool removeSettingAtKey=false) const
Copies the value from the given keys if they exist.
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 * settingsMeasureKeepBaseUnit
Settings entry for whether to keep base measurement units.
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 QgsSettingsEntryString * settingsScanZipInBrowser
Settings entry for zip scanning behavior in browser.
static const QgsSettingsEntryColor * settingsDefaultCanvasColor
Settings entry for default canvas background color.
static const QgsSettingsEntryInteger * settingsDigitizingStreamTolerance
Settings entry digitizing stream tolerance.
static const QgsSettingsEntryEnumFlag< Qgis::CadMeasurementDisplayType > * settingsDigitizingStatusBarTotalLengthDisplay
Settings entry digitizing status bar perimeter/total length display.
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 QgsSettingsEntryInteger * settingsMeasureDecimalPlaces
Settings entry for number of decimal places for measurements.
static const QgsSettingsEntryEnumFlag< Qgis::UnknownLayerCrsBehavior > * settingsUnknownCrsBehavior
Settings entry for behavior when encountering a layer with an unknown CRS (NoAction,...
static const QgsSettingsEntryColor * settingsDigitizingLineColor
Settings entry digitizing line color.
static const QgsSettingsEntryStringList * settingsScanItemsFastScanUris
Settings entry for fast scan URIs in browser.
static const QgsSettingsEntryEnumFlag< Qgis::LayerTreeInsertionMethod > * settingsLayerTreeInsertionMethod
Settings entry for layer tree insertion method.
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 * settingsLayerTreeShowIdInLayerTooltips
Settings entry for hidden ID in layer tooltips.
static const QgsSettingsEntryString * settingsMeasureAreaUnits
Settings entry for area display units.
static const QgsSettingsEntryEnumFlag< Qgis::CadMeasurementDisplayType > * settingsDigitizingStatusBarAreaDisplay
Settings entry digitizing status bar area display.
static const QgsSettingsEntryBool * settingsLayerTreeShowLegendClassifiers
Settings entry for showing legend classifiers (classification attribute name) in layer tree.
static const QgsSettingsEntryInteger * settingsSymbolsListGroupsIndex
Settings entry for symbols list groups index.
static const QgsSettingsEntryBool * settingsEnableWMSTilePrefetching
Settings entry enable WMS tile prefetching.
static const QgsSettingsEntryColor * settingsDefaultSelectionColor
Settings entry for default selection color.
static const QgsSettingsEntryEnumFlag< Qgis::EndCapStyle > * settingsDigitizingOffsetCapStyle
Settings entry digitizing offset cap style.
static const QgsSettingsEntryString * settingsLayerDefaultCrs
Settings entry for the default CRS used for layers with unknown CRS.
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 QgsSettingsEntryBool * settingsMeasurePlanimetric
Settings entry for whether measurements should be planimetric (ellipsoid off) or use the ellipsoid.
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.
static const QgsSettingsEntryString * settingsMeasureDisplayUnits
Settings entry for distance display units.
friend class QgsSettingsEntryBase
void setSelectedItem(const QString &item, const QStringList &parentsNamedItems=QStringList())
Sets the selected named item from the named list node.
QList< const QgsSettingsEntryBase * > childrenSettings() const
Returns the children settings.
static QgsSettingsTreeNode * sTreeDigitizing
static QgsSettingsTreeNode * sTreeWms
static QgsSettingsTreeNode * sTreeLayerTree
static QgsSettingsTreeNode * sTreeMeasure
static QgsSettingsTreeNode * sTreeNetworkCache
static QgsSettingsTreeNode * sTreeCrs
static QgsSettingsTreeNode * sTreeGps
static QgsSettingsTreeNode * sTreeQgis
static QgsSettingsTreeNode * sTreeMap
static QgsSettingsTreeNode * sTreeCore
Stores settings for use within QGIS.
Definition qgssettings.h:68
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.
QStringList childKeys() const
Returns a list of all top-level keys that can be read using the QSettings object.
void remove(const QString &key, QgsSettings::Section section=QgsSettings::NoSection)
Removes the setting key and any sub-settings of key in a section.
QStringList allKeys() const
Returns a list of all keys, including subkeys, that can be read using the QSettings object.
static QgsSettingsProxy get()
Returns a proxy for a QgsSettings object.
static const QgsSettingsEntryDouble * settingsLegendSymbolMaximumSize
static const QgsSettingsEntryDouble * settingsLegendSymbolMinimumSize
static const QgsSettingsEntryStringList * settingsShowInMenuList
static const QgsSettingsEntryString * settingsDefaultEncoding
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:8379
#define Q_NOWARN_DEPRECATED_PUSH
Definition qgis.h:8378