Skip to content
Permalink
Browse files

Avoid unnecessary canvas refreshes when adding group to legend

  • Loading branch information
mhugent committed Jun 8, 2011
1 parent 85d089c commit 2ab38133e1f2f8794a1c694a8b22f4e79a2f6466
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/app/legend/qgslegend.cpp
@@ -156,6 +156,9 @@ int QgsLegend::addGroupToCurrentItem( QString name, bool expand )

int QgsLegend::addGroup( QString name, bool expand, QTreeWidgetItem* parent )
{
//avoid multiple refreshes of map canvas because of itemChanged signal
blockSignals( true );

bool nameEmpty = name.isEmpty();
if ( nameEmpty )
name = tr( "group" ); // some default name if none specified
@@ -174,6 +177,7 @@ int QgsLegend::addGroup( QString name, bool expand, QTreeWidgetItem* parent )
if ( nameEmpty )
openEditor();

blockSignals( false );
return groupIndex.row();
}

0 comments on commit 2ab3813

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