Skip to content

Commit

Permalink
Fix #11200 (Symbology changes of a layer aren't reflected in overview…
Browse files Browse the repository at this point in the history
… panel)
  • Loading branch information
wonder-sk committed Sep 14, 2014
1 parent a2f5126 commit 8d04241
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/core/layertree/qgslayertreemodellegendnode.cpp
Expand Up @@ -217,8 +217,7 @@ bool QgsSymbolV2LegendNode::setData( const QVariant& value, int role )

emit dataChanged();

if ( mLayerNode->isVisible() )
vlayer->triggerRepaint();
vlayer->triggerRepaint();

return true;
}
Expand Down
21 changes: 21 additions & 0 deletions src/gui/qgsmapoverviewcanvas.cpp
Expand Up @@ -17,6 +17,8 @@
***************************************************************************/

#include "qgsmapcanvas.h"
#include "qgsmaplayer.h"
#include "qgsmaplayerregistry.h"
#include "qgsmapoverviewcanvas.h"
#include "qgsmaprenderersequentialjob.h"
#include "qgsmaptopixel.h"
Expand Down Expand Up @@ -300,6 +302,11 @@ void QgsMapOverviewCanvas::mapRenderingFinished()
update();
}

void QgsMapOverviewCanvas::layerRepaintRequested()
{
refresh();
}


void QgsMapOverviewCanvas::setBackgroundColor( const QColor& color )
{
Expand All @@ -314,7 +321,21 @@ void QgsMapOverviewCanvas::setBackgroundColor( const QColor& color )
void QgsMapOverviewCanvas::setLayerSet( const QStringList& layerSet )
{
QgsDebugMsg( "layerSet: " + layerSet.join( ", " ) );

foreach ( const QString& layerID, mSettings.layers() )
{
if ( QgsMapLayer* ml = QgsMapLayerRegistry::instance()->mapLayer( layerID ) )
disconnect( ml, SIGNAL( repaintRequested() ), this, SLOT( layerRepaintRequested() ) );
}

mSettings.setLayers( layerSet );

foreach ( const QString& layerID, mSettings.layers() )
{
if ( QgsMapLayer* ml = QgsMapLayerRegistry::instance()->mapLayer( layerID ) )
connect( ml, SIGNAL( repaintRequested() ), this, SLOT( layerRepaintRequested() ) );
}

updateFullExtent();
}

Expand Down
1 change: 1 addition & 0 deletions src/gui/qgsmapoverviewcanvas.h
Expand Up @@ -74,6 +74,7 @@ class GUI_EXPORT QgsMapOverviewCanvas : public QWidget

protected slots:
void mapRenderingFinished();
void layerRepaintRequested();

protected:

Expand Down

0 comments on commit 8d04241

Please sign in to comment.