Skip to content
Permalink
Browse files

Fix #10469 (symbology not refreshed after drag'n'drop)

  • Loading branch information
wonder-sk committed Jun 5, 2014
1 parent 6de2cdf commit 7ef06411503984a8fee1508652581aab90e960dc
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/gui/layertree/qgslayertreemodel.cpp
@@ -511,6 +511,9 @@ void QgsLayerTreeModel::nodeLayerLoaded()

void QgsLayerTreeModel::layerRendererChanged()
{
if ( !testFlag( ShowSymbology ) )
return;

QgsMapLayer* layer = qobject_cast<QgsMapLayer*>( sender() );
if ( !layer )
return;
@@ -543,8 +546,6 @@ void QgsLayerTreeModel::removeSymbologyFromLayer( QgsLayerTreeLayer* nodeLayer )
{
qDeleteAll( mSymbologyNodes[nodeLayer] );
mSymbologyNodes.remove( nodeLayer );

disconnect( nodeLayer->layer(), SIGNAL( rendererChanged() ), this, SLOT( layerRendererChanged() ) );
}
}

@@ -566,9 +567,6 @@ void QgsLayerTreeModel::addSymbologyToLayer( QgsLayerTreeLayer* nodeL )
{
addSymbologyToPluginLayer( nodeL );
}

// be ready for any subsequent changes of the renderer
connect( nodeL->layer(), SIGNAL( rendererChanged() ), this, SLOT( layerRendererChanged() ) );
}


@@ -689,6 +687,8 @@ void QgsLayerTreeModel::connectToLayer( QgsLayerTreeLayer* nodeLayer )
}

QgsMapLayer* layer = nodeLayer->layer();
connect( layer, SIGNAL( rendererChanged() ), this, SLOT( layerRendererChanged() ), Qt::UniqueConnection );

if ( layer->type() == QgsMapLayer::VectorLayer )
{
// using unique connection because there may be temporarily more nodes for a layer than just one

0 comments on commit 7ef0641

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