Skip to content
Permalink
Browse files

[composer] Instant feedback for legend when linked map changes

(cherry-picked from f9ff5e2)
  • Loading branch information
nyalldawson committed Jul 1, 2016
1 parent 4d14d36 commit 287249510b1a9e0335d8ac0ba6d7a6022cb1d31a
Showing with 7 additions and 4 deletions.
  1. +6 −3 src/core/composer/qgscomposerlegend.cpp
  2. +1 −1 src/core/composer/qgscomposerlegend.h
@@ -306,7 +306,7 @@ void QgsComposerLegend::updateLegend()

void QgsComposerLegend::updateItem()
{
updateFilterByMap();
updateFilterByMap( false );
QgsComposerItem::updateItem();
}

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

void QgsComposerLegend::updateFilterByMap()
void QgsComposerLegend::updateFilterByMap( bool redraw )
{
if ( isRemoved() )
return;
// ask for update
// the actual update will take place before the redraw.
// This is to avoid multiple calls to the filter
mFilterAskedForUpdate = true;

if ( redraw )
QgsComposerItem::updateItem();
}

void QgsComposerLegend::doUpdateFilterByMap()
@@ -255,7 +255,7 @@ class CORE_EXPORT QgsComposerLegend : public QgsComposerItem
void invalidateCurrentMap();

private slots:
void updateFilterByMap();
void updateFilterByMap( bool redraw = true );

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

0 comments on commit 2872495

Please sign in to comment.
You can’t perform that action at this time.