Skip to content

Commit f9ff5e2

Browse files
committedJun 16, 2016
[composer] Instant feedback for legend when linked map changes
1 parent dbf8d89 commit f9ff5e2

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed
 

‎src/core/composer/qgscomposerlegend.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ void QgsComposerLegend::updateLegend()
305305

306306
void QgsComposerLegend::updateItem()
307307
{
308-
updateFilterByMap();
308+
updateFilterByMap( false );
309309
QgsComposerItem::updateItem();
310310
}
311311

@@ -604,7 +604,7 @@ void QgsComposerLegend::mapLayerStyleOverridesChanged()
604604
{
605605
// legend is being filtered by map, so we need to re run the hit test too
606606
// as the style overrides may also have affected the visible symbols
607-
updateFilterByMap();
607+
updateFilterByMap( false );
608608
}
609609
else
610610
{
@@ -618,14 +618,17 @@ void QgsComposerLegend::mapLayerStyleOverridesChanged()
618618
updateItem();
619619
}
620620

621-
void QgsComposerLegend::updateFilterByMap()
621+
void QgsComposerLegend::updateFilterByMap( bool redraw )
622622
{
623623
if ( isRemoved() )
624624
return;
625625
// ask for update
626626
// the actual update will take place before the redraw.
627627
// This is to avoid multiple calls to the filter
628628
mFilterAskedForUpdate = true;
629+
630+
if ( redraw )
631+
QgsComposerItem::updateItem();
629632
}
630633

631634
void QgsComposerLegend::doUpdateFilterByMap()

‎src/core/composer/qgscomposerlegend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ class CORE_EXPORT QgsComposerLegend : public QgsComposerItem
255255
void invalidateCurrentMap();
256256

257257
private slots:
258-
void updateFilterByMap();
258+
void updateFilterByMap( bool redraw = true );
259259

260260
//! update legend in case style of associated map has changed
261261
void mapLayerStyleOverridesChanged();

0 commit comments

Comments
 (0)
Please sign in to comment.