Skip to content
Permalink
Browse files

Fix deselecting features by clicking no feature

  • Loading branch information
nyalldawson committed Jul 8, 2016
1 parent ea3fc65 commit 871ea87fc670db3e90d91179f2c8c242d22ca23d
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/app/qgsmaptoolselectutils.cpp
@@ -110,6 +110,14 @@ void QgsMapToolSelectUtils::selectSingleFeature( QgsMapCanvas* canvas, QgsGeomet
QgsFeatureIds selectedFeatures = getMatchingFeatures( canvas, selectGeometry, false, true );
if ( selectedFeatures.isEmpty() )
{
if ( !( e->modifiers() & Qt::ShiftModifier || e->modifiers() & Qt::ControlModifier ) )
{
// if no modifiers then clicking outside features clears the selection
// but if there's a shift or ctrl modifier, then it's likely the user was trying
// to modify an existing selection by adding or subtracting features and just
// missed the feature
vlayer->removeSelection();
}
QApplication::restoreOverrideCursor();
return;
}

0 comments on commit 871ea87

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