QGIS API Documentation 4.1.0-Master (64029b4150b)
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, true, 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 // gdal/skipDrivers was a comma-joined string; convert to a proper QStringList
282 {
283 QgsSettings s;
284 if ( s.contains( u"gdal/skipDrivers"_s ) )
285 {
286 const QString joined = s.value( u"gdal/skipDrivers"_s ).toString();
287 QgsApplication::settingsSkippedGdalDrivers->setValue( joined.isEmpty() ? QStringList() : joined.split( ','_L1 ) );
288 s.remove( u"gdal/skipDrivers"_s );
289 }
290 }
291
292 QgsDirectoryParamWidget::settingsDirectoryHiddenColumns->copyValueFromKey( u"dataitem/directoryHiddenColumns"_s, true );
293 QgsDirectoryParamWidget::settingsDirectoryHiddenColumns->copyValueFromKey( u"/dataitem/directoryHiddenColumns"_s, true );
294 QgsDirectoryItem::settingsMonitorDirectoriesInBrowser->copyValueFromKey( u"qgis/monitorDirectoriesInBrowser"_s, true );
295 QgsDirectoryItem::settingsMonitorDirectoriesInBrowser->copyValueFromKey( u"/qgis/monitorDirectoriesInBrowser"_s, true );
296 QgsFileBasedDataItemProvider::settingsScanItemsInBrowser->copyValueFromKey( u"qgis/scanItemsInBrowser2"_s, {}, true );
297 QgsFileBasedDataItemProvider::settingsScanItemsInBrowser->copyValueFromKey( u"/qgis/scanItemsInBrowser2"_s, {}, true );
298 settingsScanItemsFastScanUris->copyValueFromKey( u"qgis/scanItemsFastScanUris"_s, true );
299 settingsScanItemsFastScanUris->copyValueFromKey( u"/qgis/scanItemsFastScanUris"_s, true );
300 settingsSymbolsListGroupsIndex->copyValueFromKey( u"qgis/symbolsListGroupsIndex"_s, true );
301 settingsSymbolsListGroupsIndex->copyValueFromKey( u"/qgis/symbolsListGroupsIndex"_s, true );
302 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 );
303 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 );
305 ->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 );
307 ->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 );
308
309#if defined( HAVE_QTSERIALPORT )
310 QgsGpsDetector::settingsGpsStopBits->copyValueFromKey( u"core/gps/stop_bits"_s, true );
311 QgsGpsDetector::settingsGpsFlowControl->copyValueFromKey( u"core/gps/flow_control"_s, true );
312 QgsGpsDetector::settingsGpsDataBits->copyValueFromKey( u"core/gps/data_bits"_s, true );
313 QgsGpsDetector::settingsGpsParity->copyValueFromKey( u"core/gps/parity"_s, true );
314#endif
315
316 QgsRasterLayer::settingsRasterDefaultOversampling->copyValueFromKey( u"Raster/defaultOversampling"_s, true );
317 QgsRasterLayer::settingsRasterDefaultEarlyResampling->copyValueFromKey( u"Raster/defaultEarlyResampling"_s, true );
318 QgsRasterLayer::settingsRasterDefaultZoomedInResampling->copyValueFromKey( u"Raster/defaultZoomedInResampling"_s, true );
319 QgsRasterLayer::settingsRasterDefaultZoomedInResampling->copyValueFromKey( u"/Raster/defaultZoomedInResampling"_s, true );
320 QgsRasterLayer::settingsRasterDefaultZoomedOutResampling->copyValueFromKey( u"Raster/defaultZoomedOutResampling"_s, true );
321 QgsRasterLayer::settingsRasterDefaultZoomedOutResampling->copyValueFromKey( u"/Raster/defaultZoomedOutResampling"_s, true );
322 for ( const QString &rendererKey : { u"singleBand"_s, u"multiBandSingleByte"_s, u"multiBandMultiByte"_s } )
323 {
324 QgsRasterLayer::settingsRasterDefaultContrastEnhancementAlgorithm->copyValueFromKey( u"Raster/defaultContrastEnhancementAlgorithm/%1"_s, { rendererKey }, true );
325 QgsRasterLayer::settingsRasterDefaultContrastEnhancementLimits->copyValueFromKey( u"Raster/defaultContrastEnhancementLimits/%1"_s, { rendererKey }, true );
326 }
327 // No copyValueFromKey for settingsFavoriteDirs: old key "browser/favourites" is identical to new key path
328 QgsNetworkAccessManager::settingsProxyEnabled->copyValueFromKey( u"proxy/proxyEnabled"_s, true );
332 QgsNetworkAccessManager::settingsProxyPassword->copyValueFromKey( u"proxy/proxyPassword"_s, true );
334 QgsNetworkAccessManager::settingsProxyExcludedUrls->copyValueFromKey( u"proxy/proxyExcludedUrls"_s, true );
335 QgsNetworkAccessManager::settingsNoProxyUrls->copyValueFromKey( u"proxy/noProxyUrls"_s, true );
338 QgsImageCache::settingsMaxImageCacheSize->copyValueFromKey( u"qgis/maxImageCacheSize"_s, true );
339 QgsSymbolLegendNode::settingsLegendSymbolMinimumSize->copyValueFromKey( u"qgis/legendsymbolMinimumSize"_s, true );
340 QgsSymbolLegendNode::settingsLegendSymbolMaximumSize->copyValueFromKey( u"qgis/legendsymbolMaximumSize"_s, true );
341#ifdef HAVE_OPENCL
342 QgsOpenClUtils::settingsOpenClEnabled->copyValueFromKey( u"core/OpenClEnabled"_s, true );
343 QgsOpenClUtils::settingsOpenClDefaultDevice->copyValueFromKey( u"core/OpenClDefaultDevice"_s, true );
344#endif
345 QgsOgrProviderUtils::settingsWalForSqlite3->copyValueFromKey( u"qgis/walForSqlite3"_s, true );
346
347 QgsLayoutGridSettings::settingsGridStyle->copyValueFromKey( u"gui/LayoutDesigner/gridStyle"_s, true );
348 QgsLayoutGridSettings::settingsGridColor->copyValueFromKeys( u"gui/LayoutDesigner/gridRed"_s, u"gui/LayoutDesigner/gridGreen"_s, u"gui/LayoutDesigner/gridBlue"_s, u"gui/LayoutDesigner/gridAlpha"_s, true );
349 QgsLayoutGridSettings::settingsGridResolution->copyValueFromKey( u"gui/LayoutDesigner/defaultSnapGridResolution"_s, true );
350 QgsLayoutGridSettings::settingsGridOffsetX->copyValueFromKey( u"gui/LayoutDesigner/defaultSnapGridOffsetX"_s, true );
351 QgsLayoutGridSettings::settingsGridOffsetY->copyValueFromKey( u"gui/LayoutDesigner/defaultSnapGridOffsetY"_s, true );
352 QgsLayoutSnapper::settingsSnapTolerance->copyValueFromKey( u"gui/LayoutDesigner/defaultSnapTolerancePixels"_s, true );
353
354 QgsRasterRendererRegistry::settingsDefaultRedBand->copyValueFromKey( u"Raster/defaultRedBand"_s, true );
355 QgsRasterRendererRegistry::settingsDefaultGreenBand->copyValueFromKey( u"Raster/defaultGreenBand"_s, true );
356 QgsRasterRendererRegistry::settingsDefaultBlueBand->copyValueFromKey( u"Raster/defaultBlueBand"_s, true );
357 QgsRasterRendererRegistry::settingsUseStandardDeviation->copyValueFromKey( u"Raster/useStandardDeviation"_s, true );
358 QgsRasterRendererRegistry::settingsDefaultStandardDeviation->copyValueFromKey( u"Raster/defaultStandardDeviation"_s, true );
359
360 pal::Pal::settingsRenderingLabelCandidatesLimitPoints->copyValueFromKey( u"core/rendering/label_candidates_limit_points"_s, true );
361 pal::Pal::settingsRenderingLabelCandidatesLimitLines->copyValueFromKey( u"core/rendering/label_candidates_limit_lines"_s, true );
362 pal::Pal::settingsRenderingLabelCandidatesLimitPolygons->copyValueFromKey( u"core/rendering/label_candidates_limit_polygons"_s, true );
363
364 QgsCustomColorScheme::settingsPaletteColors->copyValueFromKey( u"colors/palettecolors"_s, {}, true );
365 QgsCustomColorScheme::settingsPaletteLabels->copyValueFromKey( u"colors/palettelabels"_s, {}, true );
366 QgsUserColorScheme::settingsShowInMenuList->copyValueFromKey( u"colors/showInMenuList"_s, {}, true );
367
368 // digitizing settings - added in 3.30
369 {
370 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 );
371 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 );
372
373 const QList<const QgsSettingsEntryBase *> settings = QgsSettingsTree::sTreeDigitizing->childrenSettings();
374 for ( const QgsSettingsEntryBase *setting : settings )
375 {
376 QString name = setting->name();
377 if ( name == settingsDigitizingStreamTolerance->name() || name == settingsDigitizingLineColor->name() || name == settingsDigitizingFillColor->name() )
378 continue;
379 if ( name == settingsDigitizingReuseLastValues->name() )
380 {
381 name = u"reuseLastValues"_s;
382 }
383 else
384 {
385 name.replace( '-', '_' );
386 }
387 setting->copyValueFromKey( QString( "qgis/digitizing/%1" ).arg( name ), true );
388 }
389 }
390
391 // locator filters - added in 3.30
392 {
393 QSettings &locatorSettings = QgsSettingsEntryBase::userSettings();
394 locatorSettings.beginGroup( u"gui/locator_filters"_s );
395 const QStringList childKeys = locatorSettings.childKeys();
396 locatorSettings.endGroup();
397 for ( const QString &childKey : childKeys )
398 {
399 if ( childKey.startsWith( "enabled"_L1 ) )
400 {
401 QString filter = childKey;
402 filter.remove( u"enabled_"_s );
403 QgsLocator::settingsLocatorFilterEnabled->copyValueFromKey( u"gui/locator_filters/enabled_%1"_s, { filter }, true );
404 QgsLocator::settingsLocatorFilterDefault->copyValueFromKey( u"gui/locator_filters/default_%1"_s, { filter }, true );
405 QgsLocator::settingsLocatorFilterPrefix->copyValueFromKey( u"gui/locator_filters/prefix_%1"_s, { filter }, true );
406 }
407 }
408 }
409
410 // connections settings - added in 3.30
411 const QStringList services = { u"WMS"_s, u"WFS"_s, u"WCS"_s };
412 for ( const QString &service : services )
413 {
414 QgsSettings settings;
415 settings.beginGroup( u"qgis/connections-%1"_s.arg( service.toLower() ) );
416 const QStringList connections = settings.childGroups();
417 if ( connections.count() == 0 )
418 continue;
419 for ( const QString &connection : connections )
420 {
421 if ( settings.value( u"%1/url"_s.arg( connection ) ).toString().isEmpty() )
422 continue;
423
424 QgsOwsConnection::settingsUrl->copyValueFromKey( u"qgis/connections-%1/%2/url"_s, { service.toLower(), connection }, true );
425 QgsOwsConnection::settingsVersion->copyValueFromKey( u"qgis/connections-%1/%2/version"_s, { service.toLower(), connection }, true );
426 QgsOwsConnection::settingsIgnoreGetMapURI->copyValueFromKey( u"qgis/connections-%1/%2/ignoreGetMapURI"_s, { service.toLower(), connection }, true );
427 QgsOwsConnection::settingsIgnoreGetFeatureInfoURI->copyValueFromKey( u"qgis/connections-%1/%2/ignoreGetFeatureInfoURI"_s, { service.toLower(), connection }, true );
428 QgsOwsConnection::settingsSmoothPixmapTransform->copyValueFromKey( u"qgis/connections-%1/%2/smoothPixmapTransform"_s, { service.toLower(), connection }, true );
429 QgsOwsConnection::settingsReportedLayerExtents->copyValueFromKey( u"qgis/connections-%1/%2/reportedLayerExtents"_s, { service.toLower(), connection }, true );
430 QgsOwsConnection::settingsDpiMode->copyValueFromKey( u"qgis/connections-%1/%2/dpiMode"_s, { service.toLower(), connection }, true );
431 QgsOwsConnection::settingsTilePixelRatio->copyValueFromKey( u"qgis/connections-%1/%2/tilePixelRatio"_s, { service.toLower(), connection }, true );
432 QgsOwsConnection::settingsMaxNumFeatures->copyValueFromKey( u"qgis/connections-%1/%2/maxnumfeatures"_s, { service.toLower(), connection }, true );
433 QgsOwsConnection::settingsPagesize->copyValueFromKey( u"qgis/connections-%1/%2/pagesize"_s, { service.toLower(), connection }, true );
434 QgsOwsConnection::settingsPagingEnabled->copyValueFromKey( u"qgis/connections-%1/%2/pagingenabled"_s, { service.toLower(), connection }, true );
435 QgsOwsConnection::settingsPreferCoordinatesForWfsT11->copyValueFromKey( u"qgis/connections-%1/%2/preferCoordinatesForWfsT11"_s, { service.toLower(), connection }, true );
436 QgsOwsConnection::settingsIgnoreAxisOrientation->copyValueFromKey( u"qgis/connections-%1/%2/ignoreAxisOrientation"_s, { service.toLower(), connection }, true );
437 QgsOwsConnection::settingsInvertAxisOrientation->copyValueFromKey( u"qgis/connections-%1/%2/invertAxisOrientation"_s, { service.toLower(), connection }, true );
438
440 settings.beginGroup( connection );
441 QgsOwsConnection::settingsHeaders->setValue( QgsHttpHeaders( settings ).headers(), { service.toLower(), connection } );
442 settings.remove( u"http-header"_s );
443 settings.endGroup();
445
446 QgsOwsConnection::settingsUsername->copyValueFromKey( u"qgis/connections/%1/%2/username"_s.arg( service, connection ), { service.toLower(), connection }, true );
447 QgsOwsConnection::settingsPassword->copyValueFromKey( u"qgis/connections/%1/%2/password"_s.arg( service, connection ), { service.toLower(), connection }, true );
448 QgsOwsConnection::settingsAuthCfg->copyValueFromKey( u"qgis/connections/%1/%2/authcfg"_s.arg( service, connection ), { service.toLower(), connection }, true );
449 }
450 if ( settings.contains( u"selected"_s ) )
451 QgsOwsConnection::sTreeOwsConnections->setSelectedItem( settings.value( u"selected"_s ).toString(), { service.toLower() } );
452 }
453
454 // Vector tile - added in 3.30
455 {
456 QgsSettings settings;
457 settings.beginGroup( u"qgis/connections-vector-tile"_s );
458 const QStringList connections = settings.childGroups();
459 for ( const QString &connection : connections )
460 {
461 if ( settings.value( u"%1/url"_s.arg( connection ) ).toString().isEmpty() )
462 continue;
463
464 QgsVectorTileProviderConnection::settingsUrl->copyValueFromKey( u"qgis/connections-vector-tile/%1/url"_s, { connection }, true );
465 QgsVectorTileProviderConnection::settingsZmin->copyValueFromKey( u"qgis/connections-vector-tile/%1/zmin"_s, { connection }, true );
466 QgsVectorTileProviderConnection::settingsZmax->copyValueFromKey( u"qgis/connections-vector-tile/%1/zmax"_s, { connection }, true );
467 QgsVectorTileProviderConnection::settingsAuthcfg->copyValueFromKey( u"qgis/connections-vector-tile/%1/authcfg"_s, { connection }, true );
468 QgsVectorTileProviderConnection::settingsUsername->copyValueFromKey( u"qgis/connections-vector-tile/%1/username"_s, { connection }, true );
469 QgsVectorTileProviderConnection::settingsPassword->copyValueFromKey( u"qgis/connections-vector-tile/%1/password"_s, { connection }, true );
470 QgsVectorTileProviderConnection::settingsStyleUrl->copyValueFromKey( u"qgis/connections-vector-tile/%1/styleUrl"_s, { connection }, true );
471 QgsVectorTileProviderConnection::settingsServiceType->copyValueFromKey( u"qgis/connections-vector-tile/%1/serviceType"_s, { connection }, true );
473 settings.beginGroup( connection );
474 QgsVectorTileProviderConnection::settingsHeaders->setValue( QgsHttpHeaders( settings ).headers(), connection );
475 settings.remove( u"http-header"_s );
476 settings.endGroup();
478 }
479 }
480
481 // xyz - added in 3.30
482 {
483 QgsSettings settings;
484 settings.beginGroup( u"qgis/connections-xyz"_s );
485 const QStringList connections = settings.childGroups();
486 for ( const QString &connection : connections )
487 {
488 if ( settings.value( u"%1/url"_s.arg( connection ) ).toString().isEmpty() )
489 continue;
490
491 QgsXyzConnectionSettings::settingsUrl->copyValueFromKey( u"qgis/connections-xyz/%1/url"_s, { connection }, true );
492 QgsXyzConnectionSettings::settingsZmin->copyValueFromKey( u"qgis/connections-xyz/%1/zmin"_s, { connection }, true );
493 QgsXyzConnectionSettings::settingsZmax->copyValueFromKey( u"qgis/connections-xyz/%1/zmax"_s, { connection }, true );
494 QgsXyzConnectionSettings::settingsAuthcfg->copyValueFromKey( u"qgis/connections-xyz/%1/authcfg"_s, { connection }, true );
495 QgsXyzConnectionSettings::settingsUsername->copyValueFromKey( u"qgis/connections-xyz/%1/username"_s, { connection }, true );
496 QgsXyzConnectionSettings::settingsPassword->copyValueFromKey( u"qgis/connections-xyz/%1/password"_s, { connection }, true );
497 QgsXyzConnectionSettings::settingsTilePixelRatio->copyValueFromKey( u"qgis/connections-xyz/%1/tilePixelRatio"_s, { connection }, true );
498 QgsXyzConnectionSettings::settingsHidden->copyValueFromKey( u"qgis/connections-xyz/%1/hidden"_s, { connection }, true );
499 QgsXyzConnectionSettings::settingsInterpretation->copyValueFromKey( u"qgis/connections-xyz/%1/interpretation"_s, { connection }, true );
501 settings.beginGroup( connection );
502 QgsXyzConnectionSettings::settingsHeaders->setValue( QgsHttpHeaders( settings ).headers(), connection );
503 settings.remove( u"http-header"_s );
504 settings.endGroup();
506 }
507 }
508
509 // arcgis - added in 3.30
510 {
511 // arcgismapserver entries are not used anymore (even in 3.28, only arcgisfeature server is used)
512 const QStringList serviceKeys = { u"qgis/connections-arcgisfeatureserver"_s, u"qgis/connections-arcgismapserver"_s };
513 QgsSettings settings;
514 for ( const QString &serviceKey : serviceKeys )
515 {
516 settings.beginGroup( serviceKey );
517 const QStringList connections = settings.childGroups();
518 for ( const QString &connection : connections )
519 {
520 QgsArcGisConnectionSettings::settingsUrl->copyValueFromKey( u"qgis/connections-arcgisfeatureserver/%1/url"_s, { connection }, true );
521 QgsArcGisConnectionSettings::settingsAuthcfg->copyValueFromKey( u"qgis/ARCGISFEATURESERVER/%1/authcfg"_s, { connection }, true );
522 QgsArcGisConnectionSettings::settingsUsername->copyValueFromKey( u"qgis/ARCGISFEATURESERVER/%1/username"_s, { connection }, true );
523 QgsArcGisConnectionSettings::settingsPassword->copyValueFromKey( u"qgis/ARCGISFEATURESERVER/%1/password"_s, { connection }, true );
524 QgsArcGisConnectionSettings::settingsContentEndpoint->copyValueFromKey( u"qgis/connections-arcgisfeatureserver/%1/content_endpoint"_s, { connection }, true );
525 QgsArcGisConnectionSettings::settingsCommunityEndpoint->copyValueFromKey( u"qgis/connections-arcgisfeatureserver/%1/community_endpoint"_s, { connection }, true );
527 settings.beginGroup( connection );
528 QgsArcGisConnectionSettings::settingsHeaders->setValue( QgsHttpHeaders( settings ).headers(), connection );
529 settings.remove( u"http-header"_s );
530 settings.endGroup();
532 }
533 settings.remove( serviceKey );
534 }
535 }
536
537 // babel devices settings - added in 3.30
538 {
539 if ( QgsBabelFormatRegistry::sTreeBabelDevices->items().count() == 0 )
540 {
541 const QStringList deviceNames = QgsSettingsEntryBase::userSettings().value( u"/Plugin-GPS/devices/deviceList"_s ).toStringList();
542
543 for ( const QString &device : deviceNames )
544 {
545 QgsBabelFormatRegistry::settingsBabelWptDownload->copyValueFromKey( u"/Plugin-GPS/devices/%1/wptdownload"_s, { device }, true );
546 QgsBabelFormatRegistry::settingsBabelWptUpload->copyValueFromKey( u"/Plugin-GPS/devices/%1/wptupload"_s, { device }, true );
547 QgsBabelFormatRegistry::settingsBabelRteDownload->copyValueFromKey( u"/Plugin-GPS/devices/%1/rtedownload"_s, { device }, true );
548 QgsBabelFormatRegistry::settingsBabelRteUpload->copyValueFromKey( u"/Plugin-GPS/devices/%1/rteupload"_s, { device }, true );
549 QgsBabelFormatRegistry::settingsBabelTrkDownload->copyValueFromKey( u"/Plugin-GPS/devices/%1/trkdownload"_s, { device }, true );
550 QgsBabelFormatRegistry::settingsBabelTrkUpload->copyValueFromKey( u"/Plugin-GPS/devices/%1/trkupload"_s, { device }, true );
551 }
552 }
553 }
554
555 // recent CRS
562
563 // auth settings
564 QgsAuthManager::settingsPasswordHelperInsecureFallback->copyValueFromKey( u"auth/password_helper_insecure_fallback"_s, {}, true );
565 QgsAuthManager::settingsUsePasswordHelper->copyValueFromKey( u"auth/use_password_helper"_s, {}, true );
566 QgsAuthManager::settingsPasswordHelperLogging->copyValueFromKey( u"auth/password_helper_logging"_s, {}, true );
567
568 // raster cumulative cut
569 QgsRasterMinMaxOrigin::settingsCumulativeCutLower->copyValueFromKey( u"Raster/cumulativeCutLower"_s, {}, true );
570 QgsRasterMinMaxOrigin::settingsCumulativeCutLower->copyValueFromKey( u"raster/cumulativeCutLower"_s, {}, true );
571 QgsRasterMinMaxOrigin::settingsCumulativeCutUpper->copyValueFromKey( u"Raster/cumulativeCutUpper"_s, {}, true );
572 QgsRasterMinMaxOrigin::settingsCumulativeCutUpper->copyValueFromKey( u"raster/cumulativeCutUpper"_s, {}, true );
573
574 // CptCity
575 QgsCptCityArchive::settingsCptCityBaseDir->copyValueFromKey( u"CptCity/baseDir"_s, {}, true );
576 QgsCptCityArchive::settingsCptCityBaseDir->copyValueFromKey( u"core/cptcity-base-dir"_s, {}, true );
577 QgsCptCityArchive::settingsCptCityArchiveName->copyValueFromKey( u"CptCity/archiveName"_s, {}, true );
578 QgsCptCityArchive::settingsCptCityArchiveName->copyValueFromKey( u"core/cptcity-archive-name"_s, {}, true );
579
580 // encoding
582
583 // browser custom directory colors - dynamic per-path key
584 {
585 auto settings = QgsSettings::get();
586 settings->beginGroup( u"qgis/browserPathColors"_s );
587 const QStringList keys = settings->childKeys();
588 for ( const QString &mangledPath : keys )
589 {
590 QgsDirectoryItem::settingsCustomPathColor->setValue( settings->value( mangledPath ).toString(), { mangledPath } );
591 }
592 settings->endGroup();
593 settings->remove( u"qgis/browserPathColors"_s );
594 }
595
596 // news feed disabled state - dynamic per-feed key
597 {
598 auto settings = QgsSettings::get();
599 settings->beginGroup( u"core/NewsFeed"_s );
600 const QStringList feedKeys = settings->childGroups();
601 for ( const QString &feedKey : feedKeys )
602 {
603 const QString disabledKey = feedKey + "/disabled"_L1;
604 if ( settings->contains( disabledKey ) )
605 {
606 QgsNewsFeedParser::settingsFeedDisabled->setValue( settings->value( disabledKey ).toBool(), { feedKey } );
607 settings->remove( disabledKey );
608 }
609 }
610 settings->endGroup();
611 }
612
613 // application custom variables - dynamic per-variable name key
614 {
615 auto settings = QgsSettings::get();
616 settings->beginGroup( u"variables"_s );
617 const QStringList keys = settings->childKeys();
618 for ( const QString &name : keys )
619 {
620 QgsApplication::settingsCustomVariable->setValue( settings->value( name ), { name } );
621 }
622 settings->endGroup();
623 settings->remove( u"variables"_s );
624 }
625
626 // processing default GUI parameter values - dynamic per-algorithm-id and per-parameter-name key
627 {
628 auto settings = QgsSettings::get();
629 settings->beginGroup( u"Processing/DefaultGuiParam"_s );
630 const QStringList algIds = settings->childGroups();
631 for ( const QString &algId : algIds )
632 {
633 settings->beginGroup( algId );
634 const QStringList paramNames = settings->childKeys();
635 for ( const QString &paramName : paramNames )
636 {
637 QgsProcessing::settingsDefaultGuiParam->setValue( settings->value( paramName ), { algId, paramName } );
638 }
639 settings->endGroup();
640 }
641 settings->endGroup();
642 settings->remove( u"Processing/DefaultGuiParam"_s );
643 }
644
645 // coordinate transform context - per source/destination CRS pair
646 // old keys: Projections/<srcAuthId>//<destAuthId>_coordinateOp and _allowFallback
647 {
648 auto settings = QgsSettings::get();
649 settings->beginGroup( u"Projections"_s );
650 const QStringList projectionKeys = settings->allKeys();
651 for ( const QString &key : projectionKeys )
652 {
653 if ( !key.contains( "coordinateOp"_L1 ) )
654 continue;
655 const QStringList split = key.split( '/' );
656 if ( split.size() < 2 )
657 continue;
658 const QString srcAuthId = split.at( 0 );
659 const QString destAuthId = split.at( 1 ).split( '_' ).at( 0 );
660 if ( srcAuthId.isEmpty() || destAuthId.isEmpty() )
661 continue;
662
663 const QString proj = settings->value( key ).toString();
664 const QString fallbackKey = u"%1//%2_allowFallback"_s.arg( srcAuthId, destAuthId );
665 const bool allowFallback = settings->value( fallbackKey ).toBool();
667 QgsCoordinateTransformContext::settingsAllowFallback->setValue( allowFallback, { srcAuthId, destAuthId } );
668 }
669 // remove all legacy entries
670 for ( const QString &key : projectionKeys )
671 {
672 if ( key.contains( "srcTransform"_L1 ) || key.contains( "destTransform"_L1 ) || key.contains( "coordinateOp"_L1 ) || key.contains( "allowFallback"_L1 ) )
673 {
674 settings->remove( key );
675 }
676 }
677 settings->endGroup();
678 }
679
680 // OGR DB connections (GeoPackage, SpatiaLite) - dynamic per-driver and per-connection key
681 // old keys: providers/ogr/<driver>/connections/<conn>/path and providers/ogr/<driver>/connections/selected
682 {
683 auto settings = QgsSettings::get();
684 settings->beginGroup( u"ogr"_s, QgsSettings::Section::Providers );
685 const QStringList drivers = settings->childGroups();
686 for ( const QString &driver : drivers )
687 {
688 settings->beginGroup( driver );
689 settings->beginGroup( u"connections"_s );
690 const QStringList connNames = settings->childGroups();
691 for ( const QString &connName : connNames )
692 {
693 const QString path = settings->value( u"%1/path"_s.arg( connName ) ).toString();
694 if ( !path.isEmpty() )
695 QgsOgrDbConnection::settingsOgrConnectionPath->setValue( path, { driver, connName } );
696 }
697 const QString selected = settings->value( u"selected"_s ).toString();
698 if ( !selected.isEmpty() )
699 QgsOgrDbConnection::sTreeOgrConnectionItems->setSelectedItem( selected, { driver } );
700 settings->endGroup(); // connections
701 settings->endGroup(); // driver
702 }
703 settings->endGroup(); // ogr
704 settings->remove( u"ogr"_s, QgsSettings::Section::Providers );
705 }
706}
707
708void QgsSettingsRegistryCore::backwardCompatibility()
709{}
SettingsOption
Settings options.
Definition qgis.h:751
static const Qgis::MapToolUnit DEFAULT_SNAP_UNITS
Default snapping distance units.
Definition qgis.h:6831
@ Pixels
Pixels unit of tolerance.
Definition qgis.h:5339
static const double DEFAULT_Z_COORDINATE
Default Z coordinate value.
Definition qgis.h:6808
@ Vertex
On vertices.
Definition qgis.h:778
LayerTreeInsertionMethod
Layer tree insertion methods.
Definition qgis.h:4865
@ AboveInsertionPoint
Layers are added in the tree above the insertion point.
Definition qgis.h:4866
static const double DEFAULT_SNAP_TOLERANCE
Default snapping distance tolerance.
Definition qgis.h:6826
static const double DEFAULT_M_COORDINATE
Default M coordinate value.
Definition qgis.h:6815
static QString defaultProjectScales()
A string with default project scales.
Definition qgis.cpp:674
@ Round
Use rounded joins.
Definition qgis.h:2243
CadMeasurementDisplayType
Advanced digitizing measurement display types.
Definition qgis.h:4274
@ Hidden
Hide measurement.
Definition qgis.h:4275
@ Round
Round cap.
Definition qgis.h:2230
UnknownLayerCrsBehavior
Behavior to use when encountering a layer with an unknown (invalid) CRS.
Definition qgis.h:2593
@ NoAction
Take no action and leave as unknown CRS.
Definition qgis.h:2594
EmbeddedScriptMode
Authorisation to run script embedded in projects.
Definition qgis.h:448
@ Ask
User is prompted before running scripts.
Definition qgis.h:450
@ AllLayers
On all vector layers.
Definition qgis.h:766
static const QgsSettingsEntryString * settingsApplicationFullName
static const QgsSettingsEntryString * settingsNullRepresentation
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:7753
#define Q_NOWARN_DEPRECATED_PUSH
Definition qgis.h:7752