Skip to content

Commit ead2ede

Browse files
author
rblazek
committedApr 17, 2011
legend refresh after data reload
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15750 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed
 

‎src/app/legend/qgslegendlayer.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ QgsLegendLayer::QgsLegendLayer( QgsMapLayer* layer )
9494
connect( layer, SIGNAL( editingStopped() ), this, SLOT( updateIcon() ) );
9595
connect( layer, SIGNAL( layerModified( bool ) ), this, SLOT( updateAfterLayerModification( bool ) ) );
9696
}
97+
if ( qobject_cast<QgsRasterLayer *>( layer ) )
98+
{
99+
connect( layer, SIGNAL( dataChanged() ), this, SLOT( updateAfterLayerModification() ) );
100+
}
97101
connect( layer, SIGNAL( layerNameChanged() ), this, SLOT( layerNameChanged() ) );
98102

99103
updateIcon();
@@ -545,6 +549,10 @@ void QgsLegendLayer::layerNameChanged()
545549
setText( 0, name );
546550
}
547551

552+
void QgsLegendLayer::updateAfterLayerModification()
553+
{
554+
updateAfterLayerModification( false );
555+
}
548556
void QgsLegendLayer::updateAfterLayerModification( bool onlyGeomChanged )
549557
{
550558
if ( onlyGeomChanged )

‎src/app/legend/qgslegendlayer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ class QgsLegendLayer : public QgsLegendItem
9090

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.