Skip to content
Permalink
Browse files

Avoid unnecessary canvas refreshes when adding group to legend

  • Loading branch information
mhugent committed Jun 9, 2011
1 parent 09878e5 commit f56281049623c0d7301661bc9a2cd985462c2178
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 f562810

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