Skip to content

Commit 494cde4

Browse files
committed
add new group after current item
1 parent 5a08812 commit 494cde4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/app/legend/qgslegend.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,17 @@ int QgsLegend::addGroup( QString name, bool expand, QTreeWidgetItem* parent )
169169
QgsLegendGroup *group;
170170

171171
if ( parentGroup )
172+
{
172173
group = new QgsLegendGroup( parentGroup, name );
174+
}
173175
else
176+
{
174177
group = new QgsLegendGroup( this, name );
178+
if ( currentItem() )
179+
{
180+
moveItem( group, currentItem() );
181+
}
182+
}
175183

176184
QModelIndex groupIndex = indexFromItem( group );
177185
setExpanded( groupIndex, expand );

0 commit comments

Comments
 (0)