Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix style.
  • Loading branch information
obrix committed Apr 7, 2020
1 parent c291a17 commit 6b9fb08
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
5 changes: 4 additions & 1 deletion python/core/auto_generated/qgssnappingconfig.sip.in
Expand Up @@ -73,14 +73,16 @@ This is a container of advanced configuration (per layer) of the snapping of the
%End
public:

IndividualLayerSettings( bool enabled, SnappingType type, double tolerance, QgsTolerance::UnitType units, double minScale, double maxScale ) /Deprecated/;
IndividualLayerSettings( bool enabled, SnappingType type, double tolerance, QgsTolerance::UnitType units, double minScale, double maxScale ) /Deprecated/;
%Docstring
IndividualLayerSettings

:param enabled:
:param type:
:param tolerance:
:param units:
:param minScale:
:param maxScale:

.. deprecated:: QGIS 3.12
use the method with SnappingTypeFlag instead.
Expand All @@ -96,6 +98,7 @@ IndividualLayerSettings
:param units:
:param minScale:
:param maxScale:

.. versionadded:: 3.12
%End

Expand Down
4 changes: 2 additions & 2 deletions src/app/qgssnappinglayertreemodel.cpp
Expand Up @@ -156,7 +156,7 @@ void QgsSnappingLayerDelegate::setEditorData( QWidget *editor, const QModelIndex
w->setCurrentIndex( w->findData( units ) );
}
}
else if ( index.column() == QgsSnappingLayerTreeModel::MinScaleColumn)
else if ( index.column() == QgsSnappingLayerTreeModel::MinScaleColumn )
{
QgsScaleWidget *w = qobject_cast<QgsScaleWidget *>( editor );
if ( w )
Expand Down Expand Up @@ -214,7 +214,7 @@ void QgsSnappingLayerDelegate::setModelData( QWidget *editor, QAbstractItemModel
model->setData( index, w->value(), Qt::EditRole );
}
}
else if ( index.column() == QgsSnappingLayerTreeModel::MinScaleColumn)
else if ( index.column() == QgsSnappingLayerTreeModel::MinScaleColumn )
{
QgsScaleWidget *w = qobject_cast<QgsScaleWidget *>( editor );
if ( w )
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgssnappingwidget.h
Expand Up @@ -131,7 +131,7 @@ class APP_EXPORT QgsSnappingWidget : public QWidget
DisplayMode mDisplayMode;

//! modeChanged determines if widget are visible or not based on mode
void modeChanged();
void modeChanged( );

QgsProject *mProject = nullptr;
QgsSnappingConfig mConfig;
Expand Down
4 changes: 2 additions & 2 deletions src/app/vertextool/qgsvertextool.cpp
Expand Up @@ -769,7 +769,7 @@ QgsPointLocator::Match QgsVertexTool::snapToEditableLayer( QgsMapMouseEvent *e )
continue;

config.setIndividualLayerSettings( vlayer, QgsSnappingConfig::IndividualLayerSettings(
vlayer == currentVlayer, static_cast<QgsSnappingConfig::SnappingTypeFlag>( QgsSnappingConfig::VertexFlag | QgsSnappingConfig::SegmentFlag ), tol, QgsTolerance::ProjectUnits, 0.0, 0.0 ) );
vlayer == currentVlayer, static_cast<QgsSnappingConfig::SnappingTypeFlag>( QgsSnappingConfig::VertexFlag | QgsSnappingConfig::SegmentFlag ), tol, QgsTolerance::ProjectUnits, 0.0, 0.0 ) );
}

snapUtils->setConfig( config );
Expand All @@ -796,7 +796,7 @@ QgsPointLocator::Match QgsVertexTool::snapToEditableLayer( QgsMapMouseEvent *e )
continue;

config.setIndividualLayerSettings( vlayer, QgsSnappingConfig::IndividualLayerSettings(
vlayer->isEditable(), static_cast<QgsSnappingConfig::SnappingTypeFlag>( QgsSnappingConfig::VertexFlag | QgsSnappingConfig::SegmentFlag ), tol, QgsTolerance::ProjectUnits, 0.0, 0.0 ) );
vlayer->isEditable(), static_cast<QgsSnappingConfig::SnappingTypeFlag>( QgsSnappingConfig::VertexFlag | QgsSnappingConfig::SegmentFlag ), tol, QgsTolerance::ProjectUnits, 0.0, 0.0 ) );
}

snapUtils->setConfig( config );
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgssnappingconfig.h
Expand Up @@ -120,7 +120,7 @@ class CORE_EXPORT QgsSnappingConfig
* \param maxScale
* \deprecated since QGIS 3.12 use the method with SnappingTypeFlag instead.
*/
Q_DECL_DEPRECATED IndividualLayerSettings( bool enabled, SnappingType type, double tolerance, QgsTolerance::UnitType units, double minScale, double maxScale ) SIP_DEPRECATED;
Q_DECL_DEPRECATED IndividualLayerSettings( bool enabled, SnappingType type, double tolerance, QgsTolerance::UnitType units, double minScale, double maxScale ) SIP_DEPRECATED;

/**
* \brief IndividualLayerSettings
Expand All @@ -132,7 +132,7 @@ class CORE_EXPORT QgsSnappingConfig
* \param maxScale
* \since QGIS 3.12
*/
IndividualLayerSettings( bool enabled, SnappingTypeFlag type, double tolerance, QgsTolerance::UnitType units, double minScale, double maxScale );
IndividualLayerSettings( bool enabled, SnappingTypeFlag type, double tolerance, QgsTolerance::UnitType units, double minScale, double maxScale );

/**
* Constructs an invalid setting
Expand Down
4 changes: 2 additions & 2 deletions tests/src/core/testqgssnappingutils.cpp
Expand Up @@ -33,7 +33,7 @@ struct FilterExcludePoint : public QgsPointLocator::MatchFilter
{
explicit FilterExcludePoint( const QgsPointXY &p ) : mPoint( p ) {}

bool acceptMatch( const QgsPointLocator::Match &match ) override { return match.point() != mPoint; }
bool acceptMatch( const QgsPointLocator::Match &match ) override { return match.point() != mPoint; }

QgsPointXY mPoint;
};
Expand Down Expand Up @@ -349,7 +349,7 @@ class TestQgsSnappingUtils : public QObject
QgsSnappingConfig snappingConfig = u.config();
snappingConfig.setEnabled( true );
snappingConfig.setMode( QgsSnappingConfig::AdvancedConfiguration );
QgsSnappingConfig::IndividualLayerSettings layerSettings( true, QgsSnappingConfig::VertexFlag, 0.2, QgsTolerance::ProjectUnits, 0.0, 0.0 );
QgsSnappingConfig::IndividualLayerSettings layerSettings( true, QgsSnappingConfig::VertexFlag, 0.2, QgsTolerance::ProjectUnits, 0.0, 0.0 );
snappingConfig.setIntersectionSnapping( true );
snappingConfig.setIndividualLayerSettings( vCurveZ.get(), layerSettings );
u.setConfig( snappingConfig );
Expand Down

0 comments on commit 6b9fb08

Please sign in to comment.