Skip to content

Commit dd97201

Browse files
committed
[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.
1 parent bba67ae commit dd97201

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/app/vertextool/qgsvertextool.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -676,10 +676,11 @@ QgsPointLocator::Match QgsVertexTool::snapToEditableLayer( QgsMapMouseEvent *e )
676676
QgsPointXY mapPoint = toMapCoordinates( e->pos() );
677677
double tol = QgsTolerance::vertexSearchRadius( canvas()->mapSettings() );
678678

679-
QgsSnappingConfig config( QgsProject::instance() );
679+
QgsSnappingConfig config;
680680
config.setEnabled( true );
681681
config.setMode( QgsSnappingConfig::AdvancedConfiguration );
682682
config.setIntersectionSnapping( false ); // only snap to layers
683+
Q_ASSERT( config.individualLayerSettings().isEmpty() );
683684

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

0 commit comments

Comments
 (0)