Fix adding groups to empty projects

Closes #6879 again
This commit is contained in:
Sandro Santilli 2012-12-26 20:14:18 +01:00
parent a92a0d1eb5
commit 816c32bd06

View File

@ -212,7 +212,8 @@ int QgsLegend::addGroup( QString name, bool expand, QTreeWidgetItem* parent )
{
if ( nameEmpty )
name = getUniqueGroupName( tr( "group" ), groups() );
group = new QgsLegendGroup( parent, name );
group = new QgsLegendGroup( this, name );
// TODO: warn if parent != NULL or invisibleRootItem ?
}
QModelIndex groupIndex = indexFromItem( group );