Skip to content

Commit

Permalink
add new group after current item
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Dec 29, 2011
1 parent 5a08812 commit 494cde4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/app/legend/qgslegend.cpp
Expand Up @@ -169,9 +169,17 @@ int QgsLegend::addGroup( QString name, bool expand, QTreeWidgetItem* parent )
QgsLegendGroup *group;

if ( parentGroup )
{
group = new QgsLegendGroup( parentGroup, name );
}
else
{
group = new QgsLegendGroup( this, name );
if ( currentItem() )
{
moveItem( group, currentItem() );
}
}

QModelIndex groupIndex = indexFromItem( group );
setExpanded( groupIndex, expand );
Expand Down

0 comments on commit 494cde4

Please sign in to comment.