Skip to content

Commit

Permalink
legend refresh after data reload
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@15750 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Apr 17, 2011
1 parent d7d7caf commit 191ffdf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/app/legend/qgslegendlayer.cpp
Expand Up @@ -94,6 +94,10 @@ QgsLegendLayer::QgsLegendLayer( QgsMapLayer* layer )
connect( layer, SIGNAL( editingStopped() ), this, SLOT( updateIcon() ) );
connect( layer, SIGNAL( layerModified( bool ) ), this, SLOT( updateAfterLayerModification( bool ) ) );
}
if ( qobject_cast<QgsRasterLayer *>( layer ) )
{
connect( layer, SIGNAL( dataChanged() ), this, SLOT( updateAfterLayerModification() ) );
}
connect( layer, SIGNAL( layerNameChanged() ), this, SLOT( layerNameChanged() ) );

updateIcon();
Expand Down Expand Up @@ -545,6 +549,10 @@ void QgsLegendLayer::layerNameChanged()
setText( 0, name );
}

void QgsLegendLayer::updateAfterLayerModification()
{
updateAfterLayerModification( false );
}
void QgsLegendLayer::updateAfterLayerModification( bool onlyGeomChanged )
{
if ( onlyGeomChanged )
Expand Down
1 change: 1 addition & 0 deletions src/app/legend/qgslegendlayer.h
Expand Up @@ -90,6 +90,7 @@ class QgsLegendLayer : public QgsLegendItem

/**Update symbology (e.g. to update feature count in the legend after editing operations)*/
void updateAfterLayerModification( bool onlyGeomChanged );
void updateAfterLayerModification();

void setShowFeatureCount( bool show, bool update = true );
bool showFeatureCount() const { return mShowFeatureCount; }
Expand Down

0 comments on commit 191ffdf

Please sign in to comment.