Skip to content

Commit

Permalink
Add Group button also adds selected layers if >= 2
Browse files Browse the repository at this point in the history
  • Loading branch information
uclaros authored and nyalldawson committed Mar 16, 2020
1 parent b201655 commit 9276ea8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/gui/layertree/qgslayertreeviewdefaultactions.cpp
Expand Up @@ -222,6 +222,11 @@ void QgsLayerTreeViewDefaultActions::checkAndAllParents()

void QgsLayerTreeViewDefaultActions::addGroup()
{
if ( mView->selectedNodes( true ).count() >= 2 )
{
groupSelected();
return;
}
QgsLayerTreeGroup *group = mView->currentGroupNode();
if ( !group )
group = mView->layerTreeModel()->rootGroup();
Expand Down

0 comments on commit 9276ea8

Please sign in to comment.