Skip to content

Commit

Permalink
use Qgsettins::enumSettingValue where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Feb 19, 2018
1 parent 4d6b0e6 commit 1a1b197
Show file tree
Hide file tree
Showing 34 changed files with 87 additions and 71 deletions.
8 changes: 4 additions & 4 deletions python/core/core_auto.sip
Expand Up @@ -28,7 +28,6 @@
%Include qgsdatadefinedsizelegend.sip
%Include qgsdataitemprovider.sip
%Include qgsdataitemproviderregistry.sip
%Include qgsdatasourceuri.sip
%Include qgsdatetimestatisticalsummary.sip
%Include qgsdatumtransform.sip
%Include qgsdbfilterproxymodel.sip
Expand Down Expand Up @@ -127,7 +126,6 @@
%Include qgsvectorlayerundocommand.sip
%Include qgsvectorlayerundopassthroughcommand.sip
%Include qgsvectorlayerutils.sip
%Include qgsvectorsimplifymethod.sip
%Include qgsvirtuallayerdefinition.sip
%Include qgsvirtuallayerdefinitionutils.sip
%Include qgsmapthemecollection.sip
Expand Down Expand Up @@ -258,7 +256,6 @@
%Include symbology/qgsgeometrygeneratorsymbollayer.sip
%Include layertree/qgslayertreeutils.sip
%Include locator/qgslocatorcontext.sip
%Include geometry/qgsabstractgeometry.sip
%Include geometry/qgsbox3d.sip
%Include geometry/qgscircularstring.sip
%Include geometry/qgscircle.sip
Expand Down Expand Up @@ -305,6 +302,7 @@
%Include qgscredentials.sip
%Include qgsdataitem.sip
%Include qgsdataprovider.sip
%Include qgsdatasourceuri.sip
%Include qgsfeature.sip
%Include qgsfeedback.sip
%Include qgsfield.sip
Expand Down Expand Up @@ -353,6 +351,7 @@
%Include qgsvectorlayerfeaturecounter.sip
%Include qgsvectorlayerjoinbuffer.sip
%Include qgsvectorlayertools.sip
%Include qgsvectorsimplifymethod.sip
%Include qgssettings.sip
%Include annotations/qgsannotation.sip
%Include annotations/qgsannotationmanager.sip
Expand All @@ -370,8 +369,9 @@
%Include raster/qgsrasterlayer.sip
%Include raster/qgsrasterdataprovider.sip
%Include raster/qgsrasterinterface.sip
%Include geometry/qgspoint.sip
%Include geometry/qgsabstractgeometry.sip
%Include geometry/qgsgeometry.sip
%Include geometry/qgspoint.sip
%Include geocms/geonode/qgsgeonoderequest.sip
%Include gps/qgsgpsconnection.sip
%Include gps/qgsgpsdetector.sip
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgis.sip.in
Expand Up @@ -80,7 +80,7 @@ The Qgis class provides global constants for use throughout the application.

static const double DEFAULT_SNAP_TOLERANCE;

static const int DEFAULT_SNAP_UNITS;
static const QgsTolerance::UnitType DEFAULT_SNAP_UNITS;
};


Expand Down
1 change: 1 addition & 0 deletions python/core/qgssnappingconfig.sip.in
Expand Up @@ -9,6 +9,7 @@




class QgsSnappingConfig
{
%Docstring
Expand Down
1 change: 1 addition & 0 deletions python/core/qgstolerance.sip.in
Expand Up @@ -9,6 +9,7 @@




class QgsTolerance
{
%Docstring
Expand Down
1 change: 1 addition & 0 deletions python/core/qgsvectorsimplifymethod.sip.in
Expand Up @@ -8,6 +8,7 @@




class QgsVectorSimplifyMethod
{
%Docstring
Expand Down
8 changes: 8 additions & 0 deletions python/gui/qgscolorwidgets.sip.in
Expand Up @@ -539,6 +539,14 @@ of colors.
%End
public:

enum ColorTextFormat
{
HexRgb,
HexRgbA,
Rgb,
Rgba
};

QgsColorTextWidget( QWidget *parent /TransferThis/ = 0 );
%Docstring
Construct a new color line edit widget.
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgisapp.cpp
Expand Up @@ -1770,7 +1770,7 @@ void QgisApp::applyDefaultSettingsToCanvas( QgsMapCanvas *canvas )
canvas->setParallelRenderingEnabled( settings.value( QStringLiteral( "qgis/parallel_rendering" ), true ).toBool() );
canvas->setMapUpdateInterval( settings.value( QStringLiteral( "qgis/map_update_interval" ), 250 ).toInt() );
canvas->setSegmentationTolerance( settings.value( QStringLiteral( "qgis/segmentationTolerance" ), "0.01745" ).toDouble() );
canvas->setSegmentationToleranceType( QgsAbstractGeometry::SegmentationToleranceType( settings.value( QStringLiteral( "qgis/segmentationToleranceType" ), "0" ).toInt() ) );
canvas->setSegmentationToleranceType( QgsAbstractGeometry::SegmentationToleranceType( settings.enumSettingValue( QStringLiteral( "qgis/segmentationToleranceType" ), QgsAbstractGeometry::MaximumAngle ) ) );
}

int QgisApp::chooseReasonableDefaultIconSize() const
Expand Down Expand Up @@ -1980,7 +1980,7 @@ void QgisApp::createActions()
connect( mActionOpenTable, &QAction::triggered, this, [ = ]
{
QgsSettings settings;
QgsAttributeTableFilterModel::FilterMode initialMode = static_cast< QgsAttributeTableFilterModel::FilterMode>( settings.value( QStringLiteral( "qgis/attributeTableBehavior" ), QgsAttributeTableFilterModel::ShowAll ).toInt() );
QgsAttributeTableFilterModel::FilterMode initialMode = settings.enumSettingValue( QStringLiteral( "qgis/attributeTableBehavior" ), QgsAttributeTableFilterModel::ShowAll );
attributeTable( initialMode );
} );
connect( mActionOpenFieldCalc, &QAction::triggered, this, &QgisApp::fieldCalculator );
Expand Down
17 changes: 2 additions & 15 deletions src/app/qgsclipboard.cpp
Expand Up @@ -76,15 +76,7 @@ void QgsClipboard::replaceWithCopyOf( QgsFeatureStore &featureStore )

QString QgsClipboard::generateClipboardText() const
{
QgsSettings settings;
CopyFormat format = AttributesWithWKT;
if ( settings.contains( QStringLiteral( "/qgis/copyFeatureFormat" ) ) )
format = static_cast< CopyFormat >( settings.value( QStringLiteral( "qgis/copyFeatureFormat" ), true ).toInt() );
else
{
//old format setting
format = settings.value( QStringLiteral( "qgis/copyGeometryAsWKT" ), true ).toBool() ? AttributesWithWKT : AttributesOnly;
}
CopyFormat format = QgsSettings().enumSettingValue( QStringLiteral( "qgis/copyFeatureFormat" ), AttributesWithWKT );

switch ( format )
{
Expand Down Expand Up @@ -163,12 +155,7 @@ void QgsClipboard::setSystemClipboard()

if ( mFeatureClipboard.count() < 1000 )
{
QgsSettings settings;
CopyFormat format = AttributesWithWKT;
if ( settings.contains( QStringLiteral( "/qgis/copyFeatureFormat" ) ) )
{
format = static_cast< CopyFormat >( settings.value( QStringLiteral( "qgis/copyFeatureFormat" ), true ).toInt() );
}
CopyFormat format = QgsSettings().enumSettingValue( QStringLiteral( "qgis/copyFeatureFormat" ), AttributesWithWKT );

QString htmlCopy;
switch ( format )
Expand Down
1 change: 1 addition & 0 deletions src/app/qgsclipboard.h
Expand Up @@ -58,6 +58,7 @@ class APP_EXPORT QgsClipboard : public QObject
AttributesWithWKT, //!< Tab delimited text, with geometry in WKT format
GeoJSON, //!< GeoJSON FeatureCollection format
};
Q_ENUM( CopyFormat )

/**
* Constructor for the clipboard.
Expand Down
1 change: 1 addition & 0 deletions src/app/qgscustomization.h
Expand Up @@ -115,6 +115,7 @@ class APP_EXPORT QgsCustomization : public QObject
User = 1, // Set by user
Default = 2 // Default customization loaded and set
};
Q_ENUM( Status )

//! Returns the instance pointer, creating the object on the first call
static QgsCustomization *instance();
Expand Down
8 changes: 4 additions & 4 deletions src/app/qgsmaptooloffsetcurve.cpp
Expand Up @@ -580,10 +580,10 @@ void QgsMapToolOffsetCurve::updateGeometryAndRubberBand( double offset )

QgsGeometry offsetGeom;
QgsSettings s;
QgsGeometry::JoinStyle joinStyle = static_cast< QgsGeometry::JoinStyle >( s.value( QStringLiteral( "/qgis/digitizing/offset_join_style" ), QgsGeometry::JoinStyleRound ).toInt() );
QgsGeometry::JoinStyle joinStyle = s.enumSettingValue( QStringLiteral( "/qgis/digitizing/offset_join_style" ), QgsGeometry::JoinStyleRound );
int quadSegments = s.value( QStringLiteral( "/qgis/digitizing/offset_quad_seg" ), 8 ).toInt();
double miterLimit = s.value( QStringLiteral( "/qgis/digitizing/offset_miter_limit" ), 5.0 ).toDouble();
QgsGeometry::EndCapStyle capStyle = static_cast< QgsGeometry::EndCapStyle >( s.value( QStringLiteral( "/qgis/digitizing/offset_cap_style" ), QgsGeometry::CapRound ).toInt() );
QgsGeometry::EndCapStyle capStyle = s.enumSettingValue( QStringLiteral( "/qgis/digitizing/offset_cap_style" ), QgsGeometry::CapRound );


if ( QgsWkbTypes::geometryType( mOriginalGeometry.wkbType() ) == QgsWkbTypes::LineGeometry )
Expand Down Expand Up @@ -631,10 +631,10 @@ QgsOffsetUserWidget::QgsOffsetUserWidget( QWidget *parent )
mCapStyleComboBox->addItem( tr( "Square" ), QgsGeometry::CapSquare );

QgsSettings s;
QgsGeometry::JoinStyle joinStyle = static_cast< QgsGeometry::JoinStyle >( s.value( QStringLiteral( "/qgis/digitizing/offset_join_style" ), QgsGeometry::JoinStyleRound ).toInt() );
QgsGeometry::JoinStyle joinStyle = s.enumSettingValue( QStringLiteral( "/qgis/digitizing/offset_join_style" ), QgsGeometry::JoinStyleRound );
int quadSegments = s.value( QStringLiteral( "/qgis/digitizing/offset_quad_seg" ), 8 ).toInt();
double miterLimit = s.value( QStringLiteral( "/qgis/digitizing/offset_miter_limit" ), 5.0 ).toDouble();
QgsGeometry::EndCapStyle capStyle = static_cast< QgsGeometry::EndCapStyle >( s.value( QStringLiteral( "/qgis/digitizing/offset_cap_style" ), QgsGeometry::CapRound ).toInt() );
QgsGeometry::EndCapStyle capStyle = s.enumSettingValue( QStringLiteral( "/qgis/digitizing/offset_cap_style" ), QgsGeometry::CapRound );

mJoinStyleComboBox->setCurrentIndex( mJoinStyleComboBox->findData( joinStyle ) );
mQuadrantSpinBox->setValue( quadSegments );
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolsimplify.cpp
Expand Up @@ -73,7 +73,7 @@ QgsMapToolSimplify::QgsMapToolSimplify( QgsMapCanvas *canvas )
{
QgsSettings settings;
mTolerance = settings.value( QStringLiteral( "digitizing/simplify_tolerance" ), 1 ).toDouble();
mToleranceUnits = ( QgsTolerance::UnitType ) settings.value( QStringLiteral( "digitizing/simplify_tolerance_units" ), 0 ).toInt();
mToleranceUnits = settings.enumSettingValue( QStringLiteral( "digitizing/simplify_tolerance_units" ), QgsTolerance::LayerUnits );

mSimplifyDialog = new QgsSimplifyDialog( this, canvas->topLevelWidget() );
}
Expand Down
12 changes: 4 additions & 8 deletions src/app/qgsoptions.cpp
Expand Up @@ -388,7 +388,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
cmbAttrTableBehavior->addItem( tr( "Show all features" ), QgsAttributeTableFilterModel::ShowAll );
cmbAttrTableBehavior->addItem( tr( "Show selected features" ), QgsAttributeTableFilterModel::ShowSelected );
cmbAttrTableBehavior->addItem( tr( "Show features visible on map" ), QgsAttributeTableFilterModel::ShowVisible );
cmbAttrTableBehavior->setCurrentIndex( cmbAttrTableBehavior->findData( mSettings->value( QStringLiteral( "/qgis/attributeTableBehavior" ), QgsAttributeTableFilterModel::ShowAll ).toInt() ) );
cmbAttrTableBehavior->setCurrentIndex( cmbAttrTableBehavior->findData( mSettings->enumSettingValue( QStringLiteral( "/qgis/attributeTableBehavior" ), QgsAttributeTableFilterModel::ShowAll ) ) );

mAttrTableViewComboBox->clear();
mAttrTableViewComboBox->addItem( tr( "Remember last view" ), -1 );
Expand Down Expand Up @@ -576,7 +576,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
spinMaxThreads->setValue( QgsApplication::maxThreads() );

// Default simplify drawing configuration
mSimplifyDrawingGroupBox->setChecked( mSettings->value( QStringLiteral( "/qgis/simplifyDrawingHints" ), ( int )QgsVectorSimplifyMethod::GeometrySimplification ).toInt() != QgsVectorSimplifyMethod::NoSimplification );
mSimplifyDrawingGroupBox->setChecked( mSettings->enumSettingValue( QStringLiteral( "/qgis/simplifyDrawingHints" ), QgsVectorSimplifyMethod::GeometrySimplification ) != QgsVectorSimplifyMethod::NoSimplification );
mSimplifyDrawingSpinBox->setValue( mSettings->value( QStringLiteral( "/qgis/simplifyDrawingTol" ), Qgis::DEFAULT_MAPTOPIXEL_THRESHOLD ).toFloat() );
mSimplifyDrawingAtProvider->setChecked( !mSettings->value( QStringLiteral( "/qgis/simplifyLocal" ), true ).toBool() );

Expand Down Expand Up @@ -633,11 +633,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
mComboCopyFeatureFormat->addItem( tr( "Plain text, no geometry" ), QgsClipboard::AttributesOnly );
mComboCopyFeatureFormat->addItem( tr( "Plain text, WKT geometry" ), QgsClipboard::AttributesWithWKT );
mComboCopyFeatureFormat->addItem( tr( "GeoJSON" ), QgsClipboard::GeoJSON );
if ( mSettings->contains( QStringLiteral( "/qgis/copyFeatureFormat" ) ) )
mComboCopyFeatureFormat->setCurrentIndex( mComboCopyFeatureFormat->findData( mSettings->value( QStringLiteral( "/qgis/copyFeatureFormat" ), true ).toInt() ) );
else
mComboCopyFeatureFormat->setCurrentIndex( mComboCopyFeatureFormat->findData( mSettings->value( QStringLiteral( "/qgis/copyGeometryAsWKT" ), true ).toBool() ?
QgsClipboard::AttributesWithWKT : QgsClipboard::AttributesOnly ) );
mComboCopyFeatureFormat->setCurrentIndex( mComboCopyFeatureFormat->findData( mSettings->value( QStringLiteral( "/qgis/copyFeatureFormat" ), QgsClipboard::AttributesWithWKT ) ) );
leNullValue->setText( QgsApplication::nullRepresentation() );
cbxIgnoreShapeEncoding->setChecked( mSettings->value( QStringLiteral( "/qgis/ignoreShapeEncoding" ), true ).toBool() );

Expand Down Expand Up @@ -874,7 +870,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
mDefaultSnapModeComboBox->setCurrentIndex( mDefaultSnapModeComboBox->findData( mSettings->value( QStringLiteral( "/qgis/digitizing/default_snap_type" ), QgsSnappingConfig::Vertex ).toInt() ) );
mDefaultSnappingToleranceSpinBox->setValue( mSettings->value( QStringLiteral( "/qgis/digitizing/default_snapping_tolerance" ), Qgis::DEFAULT_SNAP_TOLERANCE ).toDouble() );
mSearchRadiusVertexEditSpinBox->setValue( mSettings->value( QStringLiteral( "/qgis/digitizing/search_radius_vertex_edit" ), 10 ).toDouble() );
int defSnapUnits = mSettings->value( QStringLiteral( "/qgis/digitizing/default_snapping_tolerance_unit" ), Qgis::DEFAULT_SNAP_UNITS ).toInt();
QgsTolerance::UnitType defSnapUnits = mSettings->enumSettingValue( QStringLiteral( "/qgis/digitizing/default_snapping_tolerance_unit" ), Qgis::DEFAULT_SNAP_UNITS );
if ( defSnapUnits == QgsTolerance::ProjectUnits || defSnapUnits == QgsTolerance::LayerUnits )
{
index = mDefaultSnappingToleranceComboBox->findText( tr( "map units" ) );
Expand Down
8 changes: 4 additions & 4 deletions src/core/CMakeLists.txt
Expand Up @@ -578,6 +578,7 @@ SET(QGIS_CORE_MOC_HDRS
qgscredentials.h
qgsdataitem.h
qgsdataprovider.h
qgsdatasourceuri.h
qgsdbfilterproxymodel.h
qgsfeature.h
qgsfeedback.h
Expand Down Expand Up @@ -639,6 +640,7 @@ SET(QGIS_CORE_MOC_HDRS
qgsvectorlayerjoinbuffer.h
qgsvectorlayerrenderer.h
qgsvectorlayertools.h
qgsvectorsimplifymethod.h
qgsmapthemecollection.h
qgswebpage.h
qgswebview.h
Expand Down Expand Up @@ -670,8 +672,9 @@ SET(QGIS_CORE_MOC_HDRS
raster/qgsrasterinterface.h
raster/qgsrasterlayerrenderer.h

geometry/qgspoint.h
geometry/qgsabstractgeometry.h
geometry/qgsgeometry.h
geometry/qgspoint.h

geocms/geonode/qgsgeonoderequest.h

Expand Down Expand Up @@ -809,7 +812,6 @@ SET(QGIS_CORE_HDRS
qgsdatadefinedsizelegend.h
qgsdataitemprovider.h
qgsdataitemproviderregistry.h
qgsdatasourceuri.h
qgsdatetimestatisticalsummary.h
qgsdatumtransform.h
qgsdbfilterproxymodel.h
Expand Down Expand Up @@ -924,7 +926,6 @@ SET(QGIS_CORE_HDRS
qgsvectorlayerundocommand.h
qgsvectorlayerundopassthroughcommand.h
qgsvectorlayerutils.h
qgsvectorsimplifymethod.h
qgsvirtuallayerdefinition.h
qgsvirtuallayerdefinitionutils.h
qgsmapthemecollection.h
Expand Down Expand Up @@ -1079,7 +1080,6 @@ SET(QGIS_CORE_HDRS

locator/qgslocatorcontext.h

geometry/qgsabstractgeometry.h
geometry/qgsbox3d.h
geometry/qgscircularstring.h
geometry/qgscircle.h
Expand Down
2 changes: 2 additions & 0 deletions src/core/geometry/qgsabstractgeometry.h
Expand Up @@ -52,6 +52,7 @@ typedef QVector< QVector< QVector< QgsPoint > > > QgsCoordinateSequence;
*/
class CORE_EXPORT QgsAbstractGeometry
{
Q_GADGET

#ifdef SIP_RUN
SIP_CONVERT_TO_SUBCLASS_CODE
Expand Down Expand Up @@ -101,6 +102,7 @@ class CORE_EXPORT QgsAbstractGeometry
* curve and closest point on its approximation. */
MaximumDifference
};
Q_ENUM( SegmentationToleranceType )

/**
* Constructor for QgsAbstractGeometry.
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgis.cpp
Expand Up @@ -86,7 +86,7 @@ const double Qgis::DEFAULT_Z_COORDINATE = 0.0;

const double Qgis::DEFAULT_SNAP_TOLERANCE = 12.0;

const int Qgis::DEFAULT_SNAP_UNITS = 1;
const QgsTolerance::UnitType Qgis::DEFAULT_SNAP_UNITS = QgsTolerance::Pixels;

#ifdef Q_OS_WIN
const double Qgis::UI_SCALE_FACTOR = 1.5;
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgis.h
Expand Up @@ -19,7 +19,6 @@
#define QGIS_H

#include <QEvent>
#include "qgis_sip.h"
#include <QString>
#include <QRegExp>
#include <QMetaType>
Expand All @@ -35,6 +34,7 @@
#include <cmath>
#include <qnumeric.h>

#include "qgstolerance.h"
#include "qgswkbtypes.h"
#include "qgis_core.h"
#include "qgis_sip.h"
Expand Down Expand Up @@ -160,7 +160,7 @@ class CORE_EXPORT Qgis
* Default snapping distance units.
* \since QGIS 3.0
*/
static const int DEFAULT_SNAP_UNITS;
static const QgsTolerance::UnitType DEFAULT_SNAP_UNITS;
};

// hack to workaround warnings when casting void pointers
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgsdatasourceuri.h
Expand Up @@ -36,6 +36,7 @@
// (Radim Blazek 4/2012)
class CORE_EXPORT QgsDataSourceUri
{
Q_GADGET
public:
enum SslMode
{
Expand All @@ -46,6 +47,7 @@ class CORE_EXPORT QgsDataSourceUri
SslVerifyCa,
SslVerifyFull
};
Q_ENUM( SslMode )

//! default constructor
QgsDataSourceUri();
Expand Down
8 changes: 4 additions & 4 deletions src/core/qgssnappingconfig.cpp
Expand Up @@ -118,16 +118,16 @@ void QgsSnappingConfig::reset()
{
// get defaults values. They are both used for standard and advanced configuration (per layer)
bool enabled = QgsSettings().value( QStringLiteral( "/qgis/digitizing/default_snap_enabled" ), false ).toBool();
SnappingMode mode = static_cast<SnappingMode>( QgsSettings().value( QStringLiteral( "/qgis/digitizing/default_snap_mode" ), AllLayers ).toInt() );
SnappingMode mode = QgsSettings().enumSettingValue( QStringLiteral( "/qgis/digitizing/default_snap_mode" ), AllLayers );
if ( mode == 0 )
{
// backward compatibility with QGIS 2.x
// could be removed in 3.4+
mode = AllLayers;
}
SnappingType type = static_cast<SnappingType>( QgsSettings().value( QStringLiteral( "/qgis/digitizing/default_snap_type" ), Vertex ).toInt() );
SnappingType type = QgsSettings().enumSettingValue( QStringLiteral( "/qgis/digitizing/default_snap_type" ), Vertex );
double tolerance = QgsSettings().value( QStringLiteral( "/qgis/digitizing/default_snapping_tolerance" ), Qgis::DEFAULT_SNAP_TOLERANCE ).toDouble();
QgsTolerance::UnitType units = static_cast<QgsTolerance::UnitType>( QgsSettings().value( QStringLiteral( "/qgis/digitizing/default_snapping_tolerance_unit" ), Qgis::DEFAULT_SNAP_UNITS ).toInt() );
QgsTolerance::UnitType units = QgsSettings().enumSettingValue( QStringLiteral( "/qgis/digitizing/default_snapping_tolerance_unit" ), Qgis::DEFAULT_SNAP_UNITS );

// assign main (standard) config
mEnabled = enabled;
Expand Down Expand Up @@ -370,7 +370,7 @@ bool QgsSnappingConfig::addLayers( const QList<QgsMapLayer *> &layers )
bool enabled = QgsSettings().value( QStringLiteral( "/qgis/digitizing/default_snap_enabled" ), true ).toBool();
SnappingType type = ( SnappingType )QgsSettings().value( QStringLiteral( "/qgis/digitizing/default_snap_type" ), Vertex ).toInt();
double tolerance = QgsSettings().value( QStringLiteral( "/qgis/digitizing/default_snapping_tolerance" ), Qgis::DEFAULT_SNAP_TOLERANCE ).toDouble();
QgsTolerance::UnitType units = ( QgsTolerance::UnitType )QgsSettings().value( QStringLiteral( "/qgis/digitizing/default_snapping_tolerance_unit" ), Qgis::DEFAULT_SNAP_UNITS ).toInt();
QgsTolerance::UnitType units = QgsSettings().enumSettingValue( QStringLiteral( "/qgis/digitizing/default_snapping_tolerance_unit" ), Qgis::DEFAULT_SNAP_UNITS );

Q_FOREACH ( QgsMapLayer *ml, layers )
{
Expand Down

0 comments on commit 1a1b197

Please sign in to comment.