QGIS API Documentation 4.1.0-Master (376402f9aeb)
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 "qgsogrproviderutils.h"
38#include "qgsowsconnection.h"
39#include "qgsprocessing.h"
40#include "qgsproject.h"
41#include "qgsrasterlayer.h"
44#include "qgssettings.h"
47#include "qgssettingsproxy.h"
48#include "qgsvectorfilewriter.h"
49#include "qgsvectorlayer.h"
51
52#include <QString>
53
54#ifdef HAVE_OPENCL
55#include "qgsopenclutils.h"
56#endif
57
58#include <QSettings>
59#include <QThread>
60
61using namespace Qt::StringLiterals;
62
65
68
71
74
77
80
82
84
86
88
90
92
94
96
98
100
103
105
107
109
111
113
115
117
119
120
122 = new QgsSettingsEntryBool( u"disable-enter-attribute-values-dialog"_s, QgsSettingsTree::sTreeDigitizing, false );
123
125
127
129
131
133 = new QgsSettingsEntryDouble( u"convert-to-curve-angle-tolerance"_s, QgsSettingsTree::sTreeDigitizing, 1e-6 );
134
136 = new QgsSettingsEntryDouble( u"convert-to-curve-distance-tolerance"_s, QgsSettingsTree::sTreeDigitizing, 1e-6 );
137
139
141
143 Qgis::CadMeasurementDisplayType>( u"status-bar-area-display"_s, QgsSettingsTree::sTreeDigitizing, Qgis::CadMeasurementDisplayType::Hidden, u"Area measurement to show in status bar while digitizing"_s );
144
146 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 );
147
149
151 = 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 );
152
154 = new QgsSettingsEntryBool( u"show-legend-classifiers"_s, QgsSettingsTree::sTreeLayerTree, false, u"If true, classification attribute name is shown in the legend."_s );
155
157 = 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 );
158
160 = 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 );
161
163
165 = 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 );
166
168 = 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() );
169
171 = new QgsSettingsEntryString( u"directory"_s, QgsSettingsTree::sTreeNetworkCache, QString(), u"Network disk cache directory"_s );
172
174 = new QgsSettingsEntryInteger64( u"size-bytes"_s, QgsSettingsTree::sTreeNetworkCache, 0, u"Network disk cache size in bytes (0 = automatic size)"_s );
175
177 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 );
178
180 = 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 );
181
183 = 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 );
184
186 = new QgsSettingsEntryBool( u"planimetric"_s, QgsSettingsTree::sTreeMeasure, true, u"Whether measurements should be planimetric (ellipsoid off) or use the ellipsoid"_s );
187
189 = new QgsSettingsEntryBool( u"keep-base-unit"_s, QgsSettingsTree::sTreeMeasure, true, u"Whether to keep base measurement units instead of converting to larger units"_s );
190
192 = new QgsSettingsEntryInteger( u"decimal-places"_s, QgsSettingsTree::sTreeMeasure, 3, u"Number of decimal places for measurements"_s );
193
195 = new QgsSettingsEntryString( u"display-units"_s, QgsSettingsTree::sTreeMeasure, QString(), u"Distance display units (encoded unit string)"_s );
196
198 = new QgsSettingsEntryString( u"area-units"_s, QgsSettingsTree::sTreeMeasure, QString(), u"Area display units (encoded unit string)"_s );
199
201 Qgis::UnknownLayerCrsBehavior>( u"unknown-crs-behavior"_s, QgsSettingsTree::sTreeCrs, Qgis::UnknownLayerCrsBehavior::NoAction, u"Behavior when encountering a layer with an unknown CRS"_s );
202
204 = 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 );
205
207 Qgis::LayerTreeInsertionMethod>( u"insertion-method"_s, QgsSettingsTree::sTreeLayerTree, Qgis::LayerTreeInsertionMethod::AboveInsertionPoint, u"Method for inserting layers into the layer tree"_s );
208
210 = new QgsSettingsEntryString( u"scan-zip-in-browser"_s, QgsSettingsTree::sTreeQgis, u"basic"_s, u"Zip scanning behavior in browser (no, basic, full)"_s );
211
213 = new QgsSettingsEntryStringList( u"scan-items-fast-scan-uris"_s, QgsSettingsTree::sTreeQgis, QStringList(), u"URIs for fast scanning in browser"_s );
214
216 = new QgsSettingsEntryInteger( u"symbols-list-groups-index"_s, QgsSettingsTree::sTreeQgis, 0, u"Currently selected group index in symbols list"_s );
217
219 = new QgsSettingsEntryColor( u"default-canvas-color"_s, QgsSettingsTree::sTreeQgis, QColor( 255, 255, 255 ), u"Default canvas background color"_s );
220
222 = new QgsSettingsEntryColor( u"default-selection-color"_s, QgsSettingsTree::sTreeQgis, QColor( 255, 255, 0, 255 ), u"Default selection color"_s );
223
227
230
231void QgsSettingsRegistryCore::migrateOldSettings()
232{
233 // copy values from old keys to new keys and delete the old ones
234 // for backward compatibility, old keys are recreated when the registry gets deleted
235
236 // TODO: remove in QGIS 4.4 (after LTR 4.2)
237
238 // single settings - added in 3.30
239 QgsLayout::settingsSearchPathForTemplates->copyValueFromKey( u"core/Layout/searchPathsForTemplates"_s, true );
240 QgsLayout::settingsLayoutDefaultFont->copyValueFromKey( u"gui/LayoutDesigner/defaultFont"_s, true );
241 QgsLayout::settingsLayoutDefaultNorthArrow->copyValueFromKey( u"gui/LayoutDesigner/defaultNorthArrow"_s, true );
242
243 QgsProcessing::settingsPreferFilenameAsLayerName->copyValueFromKey( u"Processing/Configuration/PREFER_FILENAME_AS_LAYER_NAME"_s, true );
244 QgsProcessing::settingsTempPath->copyValueFromKey( u"Processing/Configuration/TEMP_PATH2"_s, true );
245
246 QgsNetworkAccessManager::settingsNetworkTimeout->copyValueFromKey( u"qgis/networkAndProxy/networkTimeout"_s, true );
247 QgsNetworkAccessManager::settingsUserAgent->copyValueFromKey( u"qgis/networkAndProxy/userAgent"_s, true );
248 QgsNetworkAccessManager::settingsUserAgent->copyValueFromKey( u"/qgis/networkAndProxy/userAgent"_s, true );
249
250 settingsLayerTreeShowFeatureCountForNewLayers->copyValueFromKey( u"core/layer-tree/show_feature_count_for_new_layers"_s, true );
251 settingsLayerTreeShowLegendClassifiers->copyValueFromKey( u"qgis/showLegendClassifiers"_s, true );
252 settingsLayerTreeShowLegendClassifiers->copyValueFromKey( u"/qgis/showLegendClassifiers"_s, true );
253
254 // single settings - added in 4.2
255 // Old code used QgsSettings::Core section, so the actual QSettings key has a "core/" prefix
256 settingsMeasurePlanimetric->copyValueFromKey( u"core/measure/planimetric"_s, true );
257 settingsMeasureKeepBaseUnit->copyValueFromKey( u"qgis/measure/keepbaseunit"_s, true );
258 settingsMeasureKeepBaseUnit->copyValueFromKey( u"/qgis/measure/keepbaseunit"_s, true );
259 settingsMeasureDecimalPlaces->copyValueFromKey( u"qgis/measure/decimalplaces"_s, true );
260 settingsMeasureDecimalPlaces->copyValueFromKey( u"/qgis/measure/decimalplaces"_s, true );
261 settingsMeasureDisplayUnits->copyValueFromKey( u"qgis/measure/displayunits"_s, true );
262 settingsMeasureDisplayUnits->copyValueFromKey( u"/qgis/measure/displayunits"_s, true );
263 settingsMeasureAreaUnits->copyValueFromKey( u"qgis/measure/areaunits"_s, true );
264 settingsMeasureAreaUnits->copyValueFromKey( u"/qgis/measure/areaunits"_s, true );
265 settingsLayerTreeInsertionMethod->copyValueFromKey( u"qgis/layerTreeInsertionMethod"_s, true );
266 settingsLayerTreeInsertionMethod->copyValueFromKey( u"/qgis/layerTreeInsertionMethod"_s, true );
267 settingsScanZipInBrowser->copyValueFromKey( u"qgis/scanZipInBrowser2"_s, true );
268 settingsScanZipInBrowser->copyValueFromKey( u"/qgis/scanZipInBrowser2"_s, true );
269 QgsProject::settingsAnonymizeNewProjects->copyValueFromKey( u"core/projects/anonymize_new_projects"_s, true );
270 QgsProject::settingsAnonymizeSavedProjects->copyValueFromKey( u"core/projects/anonymize_saved_projects"_s, true );
271 QgsProject::settingsDefaultProjectPathsRelative->copyValueFromKey( u"qgis/defaultProjectPathsRelative"_s, true );
272 QgsProject::settingsDefaultProjectPathsRelative->copyValueFromKey( u"/qgis/defaultProjectPathsRelative"_s, true );
273 // old key was stored under QgsSettings::App, i.e. "app/projections/unknownCrsBehavior"
274 settingsUnknownCrsBehavior->copyValueFromKey( u"app/projections/unknownCrsBehavior"_s, true );
275 settingsLayerDefaultCrs->copyValueFromKey( u"Projections/layerDefaultCrs"_s, true );
276 settingsLayerDefaultCrs->copyValueFromKey( u"/Projections/layerDefaultCrs"_s, true );
277 QgsApplication::settingsApplicationFullName->copyValueFromKey( u"qgis/application_full_name"_s, true );
278 QgsApplication::settingsApplicationFullName->copyValueFromKey( u"/qgis/application_full_name"_s, true );
279
280 // gdal/skipDrivers was a comma-joined string; convert to a proper QStringList
281 {
282 QgsSettings s;
283 if ( s.contains( u"gdal/skipDrivers"_s ) )
284 {
285 const QString joined = s.value( u"gdal/skipDrivers"_s ).toString();
286 QgsApplication::settingsSkippedGdalDrivers->setValue( joined.isEmpty() ? QStringList() : joined.split( ','_L1 ) );
287 s.remove( u"gdal/skipDrivers"_s );
288 }
289 }
290
291 QgsDirectoryParamWidget::settingsDirectoryHiddenColumns->copyValueFromKey( u"dataitem/directoryHiddenColumns"_s, true );
292 QgsDirectoryParamWidget::settingsDirectoryHiddenColumns->copyValueFromKey( u"/dataitem/directoryHiddenColumns"_s, true );
293 QgsDirectoryItem::settingsMonitorDirectoriesInBrowser->copyValueFromKey( u"qgis/monitorDirectoriesInBrowser"_s, true );
294 QgsDirectoryItem::settingsMonitorDirectoriesInBrowser->copyValueFromKey( u"/qgis/monitorDirectoriesInBrowser"_s, true );
295 QgsFileBasedDataItemProvider::settingsScanItemsInBrowser->copyValueFromKey( u"qgis/scanItemsInBrowser2"_s, {}, true );
296 QgsFileBasedDataItemProvider::settingsScanItemsInBrowser->copyValueFromKey( u"/qgis/scanItemsInBrowser2"_s, {}, true );
297 settingsScanItemsFastScanUris->copyValueFromKey( u"qgis/scanItemsFastScanUris"_s, true );
298 settingsScanItemsFastScanUris->copyValueFromKey( u"/qgis/scanItemsFastScanUris"_s, true );
299 settingsSymbolsListGroupsIndex->copyValueFromKey( u"qgis/symbolsListGroupsIndex"_s, true );
300 settingsSymbolsListGroupsIndex->copyValueFromKey( u"/qgis/symbolsListGroupsIndex"_s, true );
301 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 );
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 );
304 ->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 );
306 ->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
308#if defined( HAVE_QTSERIALPORT )
309 QgsGpsDetector::settingsGpsStopBits->copyValueFromKey( u"core/gps/stop_bits"_s, true );
310 QgsGpsDetector::settingsGpsFlowControl->copyValueFromKey( u"core/gps/flow_control"_s, true );
311 QgsGpsDetector::settingsGpsDataBits->copyValueFromKey( u"core/gps/data_bits"_s, true );
312 QgsGpsDetector::settingsGpsParity->copyValueFromKey( u"core/gps/parity"_s, true );
313#endif
314
315 QgsRasterLayer::settingsRasterDefaultOversampling->copyValueFromKey( u"Raster/defaultOversampling"_s, true );
316 QgsRasterLayer::settingsRasterDefaultEarlyResampling->copyValueFromKey( u"Raster/defaultEarlyResampling"_s, true );
317 QgsRasterLayer::settingsRasterDefaultZoomedInResampling->copyValueFromKey( u"Raster/defaultZoomedInResampling"_s, true );
318 QgsRasterLayer::settingsRasterDefaultZoomedInResampling->copyValueFromKey( u"/Raster/defaultZoomedInResampling"_s, true );
319 QgsRasterLayer::settingsRasterDefaultZoomedOutResampling->copyValueFromKey( u"Raster/defaultZoomedOutResampling"_s, true );
320 QgsRasterLayer::settingsRasterDefaultZoomedOutResampling->copyValueFromKey( u"/Raster/defaultZoomedOutResampling"_s, true );
321 for ( const QString &rendererKey : { u"singleBand"_s, u"multiBandSingleByte"_s, u"multiBandMultiByte"_s } )
322 {
323 QgsRasterLayer::settingsRasterDefaultContrastEnhancementAlgorithm->copyValueFromKey( u"Raster/defaultContrastEnhancementAlgorithm/%1"_s, { rendererKey }, true );
324 QgsRasterLayer::settingsRasterDefaultContrastEnhancementLimits->copyValueFromKey( u"Raster/defaultContrastEnhancementLimits/%1"_s, { rendererKey }, true );
325 }
326 // No copyValueFromKey for settingsFavoriteDirs: old key "browser/favourites" is identical to new key path
327 QgsNetworkAccessManager::settingsProxyEnabled->copyValueFromKey( u"proxy/proxyEnabled"_s, true );
331 QgsNetworkAccessManager::settingsProxyPassword->copyValueFromKey( u"proxy/proxyPassword"_s, true );
333 QgsNetworkAccessManager::settingsProxyExcludedUrls->copyValueFromKey( u"proxy/proxyExcludedUrls"_s, true );
334 QgsNetworkAccessManager::settingsNoProxyUrls->copyValueFromKey( u"proxy/noProxyUrls"_s, true );
337 QgsImageCache::settingsMaxImageCacheSize->copyValueFromKey( u"qgis/maxImageCacheSize"_s, true );
338 QgsSymbolLegendNode::settingsLegendSymbolMinimumSize->copyValueFromKey( u"qgis/legendsymbolMinimumSize"_s, true );
339 QgsSymbolLegendNode::settingsLegendSymbolMaximumSize->copyValueFromKey( u"qgis/legendsymbolMaximumSize"_s, true );
340#ifdef HAVE_OPENCL
341 QgsOpenClUtils::settingsOpenClEnabled->copyValueFromKey( u"core/OpenClEnabled"_s, true );
342 QgsOpenClUtils::settingsOpenClDefaultDevice->copyValueFromKey( u"core/OpenClDefaultDevice"_s, true );
343#endif
344 QgsOgrProviderUtils::settingsWalForSqlite3->copyValueFromKey( u"qgis/walForSqlite3"_s, true );
345
346 QgsLayoutGridSettings::settingsGridStyle->copyValueFromKey( u"gui/LayoutDesigner/gridStyle"_s, true );
347 QgsLayoutGridSettings::settingsGridColor->copyValueFromKeys( u"gui/LayoutDesigner/gridRed"_s, u"gui/LayoutDesigner/gridGreen"_s, u"gui/LayoutDesigner/gridBlue"_s, u"gui/LayoutDesigner/gridAlpha"_s, true );
348 QgsLayoutGridSettings::settingsGridResolution->copyValueFromKey( u"gui/LayoutDesigner/defaultSnapGridResolution"_s, true );
349 QgsLayoutGridSettings::settingsGridOffsetX->copyValueFromKey( u"gui/LayoutDesigner/defaultSnapGridOffsetX"_s, true );
350 QgsLayoutGridSettings::settingsGridOffsetY->copyValueFromKey( u"gui/LayoutDesigner/defaultSnapGridOffsetY"_s, true );
351 QgsLayoutSnapper::settingsSnapTolerance->copyValueFromKey( u"gui/LayoutDesigner/defaultSnapTolerancePixels"_s, true );
352
353 QgsRasterRendererRegistry::settingsDefaultRedBand->copyValueFromKey( u"Raster/defaultRedBand"_s, true );
354 QgsRasterRendererRegistry::settingsDefaultGreenBand->copyValueFromKey( u"Raster/defaultGreenBand"_s, true );
355 QgsRasterRendererRegistry::settingsDefaultBlueBand->copyValueFromKey( u"Raster/defaultBlueBand"_s, true );
356 QgsRasterRendererRegistry::settingsUseStandardDeviation->copyValueFromKey( u"Raster/useStandardDeviation"_s, true );
357 QgsRasterRendererRegistry::settingsDefaultStandardDeviation->copyValueFromKey( u"Raster/defaultStandardDeviation"_s, true );
358
359 pal::Pal::settingsRenderingLabelCandidatesLimitPoints->copyValueFromKey( u"core/rendering/label_candidates_limit_points"_s, true );
360 pal::Pal::settingsRenderingLabelCandidatesLimitLines->copyValueFromKey( u"core/rendering/label_candidates_limit_lines"_s, true );
361 pal::Pal::settingsRenderingLabelCandidatesLimitPolygons->copyValueFromKey( u"core/rendering/label_candidates_limit_polygons"_s, true );
362
363 QgsCustomColorScheme::settingsPaletteColors->copyValueFromKey( u"colors/palettecolors"_s, {}, true );
364 QgsCustomColorScheme::settingsPaletteLabels->copyValueFromKey( u"colors/palettelabels"_s, {}, true );
365 QgsUserColorScheme::settingsShowInMenuList->copyValueFromKey( u"colors/showInMenuList"_s, {}, true );
366
367 // digitizing settings - added in 3.30
368 {
369 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 );
370 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 );
371
372 const QList<const QgsSettingsEntryBase *> settings = QgsSettingsTree::sTreeDigitizing->childrenSettings();
373 for ( const QgsSettingsEntryBase *setting : settings )
374 {
375 QString name = setting->name();
376 if ( name == settingsDigitizingStreamTolerance->name() || name == settingsDigitizingLineColor->name() || name == settingsDigitizingFillColor->name() )
377 continue;
378 if ( name == settingsDigitizingReuseLastValues->name() )
379 {
380 name = u"reuseLastValues"_s;
381 }
382 else
383 {
384 name.replace( '-', '_' );
385 }
386 setting->copyValueFromKey( QString( "qgis/digitizing/%1" ).arg( name ), true );
387 }
388 }
389
390 // locator filters - added in 3.30
391 {
392 QSettings &locatorSettings = QgsSettingsEntryBase::userSettings();
393 locatorSettings.beginGroup( u"gui/locator_filters"_s );
394 const QStringList childKeys = locatorSettings.childKeys();
395 locatorSettings.endGroup();
396 for ( const QString &childKey : childKeys )
397 {
398 if ( childKey.startsWith( "enabled"_L1 ) )
399 {
400 QString filter = childKey;
401 filter.remove( u"enabled_"_s );
402 QgsLocator::settingsLocatorFilterEnabled->copyValueFromKey( u"gui/locator_filters/enabled_%1"_s, { filter }, true );
403 QgsLocator::settingsLocatorFilterDefault->copyValueFromKey( u"gui/locator_filters/default_%1"_s, { filter }, true );
404 QgsLocator::settingsLocatorFilterPrefix->copyValueFromKey( u"gui/locator_filters/prefix_%1"_s, { filter }, true );
405 }
406 }
407 }
408
409 // connections settings - added in 3.30
410 const QStringList services = { u"WMS"_s, u"WFS"_s, u"WCS"_s };
411 for ( const QString &service : services )
412 {
413 QgsSettings settings;
414 settings.beginGroup( u"qgis/connections-%1"_s.arg( service.toLower() ) );
415 const QStringList connections = settings.childGroups();
416 if ( connections.count() == 0 )
417 continue;
418 for ( const QString &connection : connections )
419 {
420 if ( settings.value( u"%1/url"_s.arg( connection ) ).toString().isEmpty() )
421 continue;
422
423 QgsOwsConnection::settingsUrl->copyValueFromKey( u"qgis/connections-%1/%2/url"_s, { service.toLower(), connection }, true );
424 QgsOwsConnection::settingsVersion->copyValueFromKey( u"qgis/connections-%1/%2/version"_s, { service.toLower(), connection }, true );
425 QgsOwsConnection::settingsIgnoreGetMapURI->copyValueFromKey( u"qgis/connections-%1/%2/ignoreGetMapURI"_s, { service.toLower(), connection }, true );
426 QgsOwsConnection::settingsIgnoreGetFeatureInfoURI->copyValueFromKey( u"qgis/connections-%1/%2/ignoreGetFeatureInfoURI"_s, { service.toLower(), connection }, true );
427 QgsOwsConnection::settingsSmoothPixmapTransform->copyValueFromKey( u"qgis/connections-%1/%2/smoothPixmapTransform"_s, { service.toLower(), connection }, true );
428 QgsOwsConnection::settingsReportedLayerExtents->copyValueFromKey( u"qgis/connections-%1/%2/reportedLayerExtents"_s, { service.toLower(), connection }, true );
429 QgsOwsConnection::settingsDpiMode->copyValueFromKey( u"qgis/connections-%1/%2/dpiMode"_s, { service.toLower(), connection }, true );
430 QgsOwsConnection::settingsTilePixelRatio->copyValueFromKey( u"qgis/connections-%1/%2/tilePixelRatio"_s, { service.toLower(), connection }, true );
431 QgsOwsConnection::settingsMaxNumFeatures->copyValueFromKey( u"qgis/connections-%1/%2/maxnumfeatures"_s, { service.toLower(), connection }, true );
432 QgsOwsConnection::settingsPagesize->copyValueFromKey( u"qgis/connections-%1/%2/pagesize"_s, { service.toLower(), connection }, true );
433 QgsOwsConnection::settingsPagingEnabled->copyValueFromKey( u"qgis/connections-%1/%2/pagingenabled"_s, { service.toLower(), connection }, true );
434 QgsOwsConnection::settingsPreferCoordinatesForWfsT11->copyValueFromKey( u"qgis/connections-%1/%2/preferCoordinatesForWfsT11"_s, { service.toLower(), connection }, true );
435 QgsOwsConnection::settingsIgnoreAxisOrientation->copyValueFromKey( u"qgis/connections-%1/%2/ignoreAxisOrientation"_s, { service.toLower(), connection }, true );
436 QgsOwsConnection::settingsInvertAxisOrientation->copyValueFromKey( u"qgis/connections-%1/%2/invertAxisOrientation"_s, { service.toLower(), connection }, true );
437
439 settings.beginGroup( connection );
440 QgsOwsConnection::settingsHeaders->setValue( QgsHttpHeaders( settings ).headers(), { service.toLower(), connection } );
441 settings.remove( u"http-header"_s );
442 settings.endGroup();
444
445 QgsOwsConnection::settingsUsername->copyValueFromKey( u"qgis/connections/%1/%2/username"_s.arg( service, connection ), { service.toLower(), connection }, true );
446 QgsOwsConnection::settingsPassword->copyValueFromKey( u"qgis/connections/%1/%2/password"_s.arg( service, connection ), { service.toLower(), connection }, true );
447 QgsOwsConnection::settingsAuthCfg->copyValueFromKey( u"qgis/connections/%1/%2/authcfg"_s.arg( service, connection ), { service.toLower(), connection }, true );
448 }
449 if ( settings.contains( u"selected"_s ) )
450 QgsOwsConnection::sTreeOwsConnections->setSelectedItem( settings.value( u"selected"_s ).toString(), { service.toLower() } );
451 }
452
453 // Vector tile - added in 3.30
454 {
455 QgsSettings settings;
456 settings.beginGroup( u"qgis/connections-vector-tile"_s );
457 const QStringList connections = settings.childGroups();
458 for ( const QString &connection : connections )
459 {
460 if ( settings.value( u"%1/url"_s.arg( connection ) ).toString().isEmpty() )
461 continue;
462
463 QgsVectorTileProviderConnection::settingsUrl->copyValueFromKey( u"qgis/connections-vector-tile/%1/url"_s, { connection }, true );
464 QgsVectorTileProviderConnection::settingsZmin->copyValueFromKey( u"qgis/connections-vector-tile/%1/zmin"_s, { connection }, true );
465 QgsVectorTileProviderConnection::settingsZmax->copyValueFromKey( u"qgis/connections-vector-tile/%1/zmax"_s, { connection }, true );
466 QgsVectorTileProviderConnection::settingsAuthcfg->copyValueFromKey( u"qgis/connections-vector-tile/%1/authcfg"_s, { connection }, true );
467 QgsVectorTileProviderConnection::settingsUsername->copyValueFromKey( u"qgis/connections-vector-tile/%1/username"_s, { connection }, true );
468 QgsVectorTileProviderConnection::settingsPassword->copyValueFromKey( u"qgis/connections-vector-tile/%1/password"_s, { connection }, true );
469 QgsVectorTileProviderConnection::settingsStyleUrl->copyValueFromKey( u"qgis/connections-vector-tile/%1/styleUrl"_s, { connection }, true );
470 QgsVectorTileProviderConnection::settingsServiceType->copyValueFromKey( u"qgis/connections-vector-tile/%1/serviceType"_s, { connection }, true );
472 settings.beginGroup( connection );
473 QgsVectorTileProviderConnection::settingsHeaders->setValue( QgsHttpHeaders( settings ).headers(), connection );
474 settings.remove( u"http-header"_s );
475 settings.endGroup();
477 }
478 }
479
480 // xyz - added in 3.30
481 {
482 QgsSettings settings;
483 settings.beginGroup( u"qgis/connections-xyz"_s );
484 const QStringList connections = settings.childGroups();
485 for ( const QString &connection : connections )
486 {
487 if ( settings.value( u"%1/url"_s.arg( connection ) ).toString().isEmpty() )
488 continue;
489
490 QgsXyzConnectionSettings::settingsUrl->copyValueFromKey( u"qgis/connections-xyz/%1/url"_s, { connection }, true );
491 QgsXyzConnectionSettings::settingsZmin->copyValueFromKey( u"qgis/connections-xyz/%1/zmin"_s, { connection }, true );
492 QgsXyzConnectionSettings::settingsZmax->copyValueFromKey( u"qgis/connections-xyz/%1/zmax"_s, { connection }, true );
493 QgsXyzConnectionSettings::settingsAuthcfg->copyValueFromKey( u"qgis/connections-xyz/%1/authcfg"_s, { connection }, true );
494 QgsXyzConnectionSettings::settingsUsername->copyValueFromKey( u"qgis/connections-xyz/%1/username"_s, { connection }, true );
495 QgsXyzConnectionSettings::settingsPassword->copyValueFromKey( u"qgis/connections-xyz/%1/password"_s, { connection }, true );
496 QgsXyzConnectionSettings::settingsTilePixelRatio->copyValueFromKey( u"qgis/connections-xyz/%1/tilePixelRatio"_s, { connection }, true );
497 QgsXyzConnectionSettings::settingsHidden->copyValueFromKey( u"qgis/connections-xyz/%1/hidden"_s, { connection }, true );
498 QgsXyzConnectionSettings::settingsInterpretation->copyValueFromKey( u"qgis/connections-xyz/%1/interpretation"_s, { connection }, true );
500 settings.beginGroup( connection );
501 QgsXyzConnectionSettings::settingsHeaders->setValue( QgsHttpHeaders( settings ).headers(), connection );
502 settings.remove( u"http-header"_s );
503 settings.endGroup();
505 }
506 }
507
508 // arcgis - added in 3.30
509 {
510 // arcgismapserver entries are not used anymore (even in 3.28, only arcgisfeature server is used)
511 const QStringList serviceKeys = { u"qgis/connections-arcgisfeatureserver"_s, u"qgis/connections-arcgismapserver"_s };
512 QgsSettings settings;
513 for ( const QString &serviceKey : serviceKeys )
514 {
515 settings.beginGroup( serviceKey );
516 const QStringList connections = settings.childGroups();
517 for ( const QString &connection : connections )
518 {
519 QgsArcGisConnectionSettings::settingsUrl->copyValueFromKey( u"qgis/connections-arcgisfeatureserver/%1/url"_s, { connection }, true );
520 QgsArcGisConnectionSettings::settingsAuthcfg->copyValueFromKey( u"qgis/ARCGISFEATURESERVER/%1/authcfg"_s, { connection }, true );
521 QgsArcGisConnectionSettings::settingsUsername->copyValueFromKey( u"qgis/ARCGISFEATURESERVER/%1/username"_s, { connection }, true );
522 QgsArcGisConnectionSettings::settingsPassword->copyValueFromKey( u"qgis/ARCGISFEATURESERVER/%1/password"_s, { connection }, true );
523 QgsArcGisConnectionSettings::settingsContentEndpoint->copyValueFromKey( u"qgis/connections-arcgisfeatureserver/%1/content_endpoint"_s, { connection }, true );
524 QgsArcGisConnectionSettings::settingsCommunityEndpoint->copyValueFromKey( u"qgis/connections-arcgisfeatureserver/%1/community_endpoint"_s, { connection }, true );
526 settings.beginGroup( connection );
527 QgsArcGisConnectionSettings::settingsHeaders->setValue( QgsHttpHeaders( settings ).headers(), connection );
528 settings.remove( u"http-header"_s );
529 settings.endGroup();
531 }
532 settings.remove( serviceKey );
533 }
534 }
535
536 // babel devices settings - added in 3.30
537 {
538 if ( QgsBabelFormatRegistry::sTreeBabelDevices->items().count() == 0 )
539 {
540 const QStringList deviceNames = QgsSettingsEntryBase::userSettings().value( u"/Plugin-GPS/devices/deviceList"_s ).toStringList();
541
542 for ( const QString &device : deviceNames )
543 {
544 QgsBabelFormatRegistry::settingsBabelWptDownload->copyValueFromKey( u"/Plugin-GPS/devices/%1/wptdownload"_s, { device }, true );
545 QgsBabelFormatRegistry::settingsBabelWptUpload->copyValueFromKey( u"/Plugin-GPS/devices/%1/wptupload"_s, { device }, true );
546 QgsBabelFormatRegistry::settingsBabelRteDownload->copyValueFromKey( u"/Plugin-GPS/devices/%1/rtedownload"_s, { device }, true );
547 QgsBabelFormatRegistry::settingsBabelRteUpload->copyValueFromKey( u"/Plugin-GPS/devices/%1/rteupload"_s, { device }, true );
548 QgsBabelFormatRegistry::settingsBabelTrkDownload->copyValueFromKey( u"/Plugin-GPS/devices/%1/trkdownload"_s, { device }, true );
549 QgsBabelFormatRegistry::settingsBabelTrkUpload->copyValueFromKey( u"/Plugin-GPS/devices/%1/trkupload"_s, { device }, true );
550 }
551 }
552 }
553
554 // recent CRS
561
562 // auth settings
563 QgsAuthManager::settingsPasswordHelperInsecureFallback->copyValueFromKey( u"auth/password_helper_insecure_fallback"_s, {}, true );
564 QgsAuthManager::settingsUsePasswordHelper->copyValueFromKey( u"auth/use_password_helper"_s, {}, true );
565 QgsAuthManager::settingsPasswordHelperLogging->copyValueFromKey( u"auth/password_helper_logging"_s, {}, true );
566
567 // raster cumulative cut
568 QgsRasterMinMaxOrigin::settingsCumulativeCutLower->copyValueFromKey( u"Raster/cumulativeCutLower"_s, {}, true );
569 QgsRasterMinMaxOrigin::settingsCumulativeCutLower->copyValueFromKey( u"raster/cumulativeCutLower"_s, {}, true );
570 QgsRasterMinMaxOrigin::settingsCumulativeCutUpper->copyValueFromKey( u"Raster/cumulativeCutUpper"_s, {}, true );
571 QgsRasterMinMaxOrigin::settingsCumulativeCutUpper->copyValueFromKey( u"raster/cumulativeCutUpper"_s, {}, true );
572
573 // CptCity
574 QgsCptCityArchive::settingsCptCityBaseDir->copyValueFromKey( u"CptCity/baseDir"_s, {}, true );
575 QgsCptCityArchive::settingsCptCityBaseDir->copyValueFromKey( u"core/cptcity-base-dir"_s, {}, true );
576 QgsCptCityArchive::settingsCptCityArchiveName->copyValueFromKey( u"CptCity/archiveName"_s, {}, true );
577 QgsCptCityArchive::settingsCptCityArchiveName->copyValueFromKey( u"core/cptcity-archive-name"_s, {}, true );
578
579 // encoding
581
582 // browser custom directory colors - dynamic per-path key
583 {
584 auto settings = QgsSettings::get();
585 settings->beginGroup( u"qgis/browserPathColors"_s );
586 const QStringList keys = settings->childKeys();
587 for ( const QString &mangledPath : keys )
588 {
589 QgsDirectoryItem::settingsCustomPathColor->setValue( settings->value( mangledPath ).toString(), { mangledPath } );
590 }
591 settings->endGroup();
592 settings->remove( u"qgis/browserPathColors"_s );
593 }
594
595 // news feed disabled state - dynamic per-feed key
596 {
597 auto settings = QgsSettings::get();
598 settings->beginGroup( u"core/NewsFeed"_s );
599 const QStringList feedKeys = settings->childGroups();
600 for ( const QString &feedKey : feedKeys )
601 {
602 const QString disabledKey = feedKey + "/disabled"_L1;
603 if ( settings->contains( disabledKey ) )
604 {
605 QgsNewsFeedParser::settingsFeedDisabled->setValue( settings->value( disabledKey ).toBool(), { feedKey } );
606 settings->remove( disabledKey );
607 }
608 }
609 settings->endGroup();
610 }
611
612 // application custom variables - dynamic per-variable name key
613 {
614 auto settings = QgsSettings::get();
615 settings->beginGroup( u"variables"_s );
616 const QStringList keys = settings->childKeys();
617 for ( const QString &name : keys )
618 {
619 QgsApplication::settingsCustomVariable->setValue( settings->value( name ), { name } );
620 }
621 settings->endGroup();
622 settings->remove( u"variables"_s );
623 }
624
625 // processing default GUI parameter values - dynamic per-algorithm-id and per-parameter-name key
626 {
627 auto settings = QgsSettings::get();
628 settings->beginGroup( u"Processing/DefaultGuiParam"_s );
629 const QStringList algIds = settings->childGroups();
630 for ( const QString &algId : algIds )
631 {
632 settings->beginGroup( algId );
633 const QStringList paramNames = settings->childKeys();
634 for ( const QString &paramName : paramNames )
635 {
636 QgsProcessing::settingsDefaultGuiParam->setValue( settings->value( paramName ), { algId, paramName } );
637 }
638 settings->endGroup();
639 }
640 settings->endGroup();
641 settings->remove( u"Processing/DefaultGuiParam"_s );
642 }
643
644 // coordinate transform context - per source/destination CRS pair
645 // old keys: Projections/<srcAuthId>//<destAuthId>_coordinateOp and _allowFallback
646 {
647 auto settings = QgsSettings::get();
648 settings->beginGroup( u"Projections"_s );
649 const QStringList projectionKeys = settings->allKeys();
650 for ( const QString &key : projectionKeys )
651 {
652 if ( !key.contains( "coordinateOp"_L1 ) )
653 continue;
654 const QStringList split = key.split( '/' );
655 if ( split.size() < 2 )
656 continue;
657 const QString srcAuthId = split.at( 0 );
658 const QString destAuthId = split.at( 1 ).split( '_' ).at( 0 );
659 if ( srcAuthId.isEmpty() || destAuthId.isEmpty() )
660 continue;
661
662 const QString proj = settings->value( key ).toString();
663 const QString fallbackKey = u"%1//%2_allowFallback"_s.arg( srcAuthId, destAuthId );
664 const bool allowFallback = settings->value( fallbackKey ).toBool();
666 QgsCoordinateTransformContext::settingsAllowFallback->setValue( allowFallback, { srcAuthId, destAuthId } );
667 }
668 // remove all legacy entries
669 for ( const QString &key : projectionKeys )
670 {
671 if ( key.contains( "srcTransform"_L1 ) || key.contains( "destTransform"_L1 ) || key.contains( "coordinateOp"_L1 ) || key.contains( "allowFallback"_L1 ) )
672 {
673 settings->remove( key );
674 }
675 }
676 settings->endGroup();
677 }
678}
679
680void QgsSettingsRegistryCore::backwardCompatibility()
681{}
SettingsOption
Settings options.
Definition qgis.h:751
static const Qgis::MapToolUnit DEFAULT_SNAP_UNITS
Default snapping distance units.
Definition qgis.h:6757
@ Pixels
Pixels unit of tolerance.
Definition qgis.h:5296
static const double DEFAULT_Z_COORDINATE
Default Z coordinate value.
Definition qgis.h:6734
@ Vertex
On vertices.
Definition qgis.h:778
LayerTreeInsertionMethod
Layer tree insertion methods.
Definition qgis.h:4822
@ AboveInsertionPoint
Layers are added in the tree above the insertion point.
Definition qgis.h:4823
static const double DEFAULT_SNAP_TOLERANCE
Default snapping distance tolerance.
Definition qgis.h:6752
static const double DEFAULT_M_COORDINATE
Default M coordinate value.
Definition qgis.h:6741
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:7678
#define Q_NOWARN_DEPRECATED_PUSH
Definition qgis.h:7677