Skip to content

Commit 2872495

Browse files
committed
[composer] Instant feedback for legend when linked map changes
(cherry-picked from f9ff5e2)
1 parent 4d14d36 commit 2872495

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
@@ -306,7 +306,7 @@ void QgsComposerLegend::updateLegend()
306306

307307
void QgsComposerLegend::updateItem()
308308
{
309-
updateFilterByMap();
309+
updateFilterByMap( false );
310310
QgsComposerItem::updateItem();
311311
}
312312

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

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

632635
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)