legend refresh after data reload

git-svn-id: http://svn.osgeo.org/qgis/trunk@15750 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
rblazek 2011-04-17 16:07:29 +00:00
parent d7d7caf446
commit 191ffdff6c
2 changed files with 9 additions and 0 deletions

View File

@ -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();
@ -545,6 +549,10 @@ void QgsLegendLayer::layerNameChanged()
setText( 0, name );
}
void QgsLegendLayer::updateAfterLayerModification()
{
updateAfterLayerModification( false );
}
void QgsLegendLayer::updateAfterLayerModification( bool onlyGeomChanged )
{
if ( onlyGeomChanged )

View File

@ -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; }