Skip to content
Browse files

Do not show in composer legend unused layers if filtering by map is e…


This resolves #11457 and partially #11293
  • Loading branch information
wonder-sk committed Oct 24, 2014
1 parent 6bde8a2 commit 4ac94f2275535c80f96f8fe7da455f1585781aec
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/core/qgslegendrenderer.cpp
@@ -208,6 +208,12 @@ QList<QgsLegendRenderer::Atom> QgsLegendRenderer::createAtomList( QgsLayerTreeGr

QList<QgsLayerTreeModelLegendNode*> legendNodes = mLegendModel->layerLegendNodes( nodeLayer );

// workaround for the issue that "filtering by map" does not remove layer nodes that have no symbols present
// on the map. We explicitly skip such layers here. In future ideally that should be handled directly
// in the layer tree model
if ( legendNodes.isEmpty() && mLegendModel->legendFilterByMap() )

QList<Atom> layerAtoms;

for ( int j = 0; j < legendNodes.count(); j++ )

0 comments on commit 4ac94f2

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