Skip to content
Permalink
Browse files

[vertex tool] Fix issue with hidden layers being editable (fixes #18434)

The problem was that QgsSnappingConfig when initialized from a project
loads global settings from QgsSettings and sets individual layer configs
based on that.

The issue was showing up only in "current layer" mode of vertex tool
because for "all layers" mode all individual layer configs were overwritten.

(cherry picked from commit dd97201)
  • Loading branch information
wonder-sk authored and nyalldawson committed Jan 25, 2019
1 parent f988f6f commit 2ad47198c446a1f541dca195439bb432da0dce6a
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/app/vertextool/qgsvertextool.cpp
@@ -693,10 +693,11 @@ QgsPointLocator::Match QgsVertexTool::snapToEditableLayer( QgsMapMouseEvent *e )
QgsPointXY mapPoint = toMapCoordinates( e->pos() );
double tol = QgsTolerance::vertexSearchRadius( canvas()->mapSettings() );

QgsSnappingConfig config( QgsProject::instance() );
QgsSnappingConfig config;
config.setEnabled( true );
config.setMode( QgsSnappingConfig::AdvancedConfiguration );
config.setIntersectionSnapping( false ); // only snap to layers
Q_ASSERT( config.individualLayerSettings().isEmpty() );

// if there is a current layer, it should have priority over other layers
// because sometimes there may be match from multiple layers at one location

0 comments on commit 2ad4719

Please sign in to comment.
You can’t perform that action at this time.