Skip to content

Commit 4ac94f2

Browse files
committedOct 24, 2014
Do not show in composer legend unused layers if filtering by map is enabled
This resolves #11457 and partially #11293
1 parent 6bde8a2 commit 4ac94f2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎src/core/qgslegendrenderer.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,12 @@ QList<QgsLegendRenderer::Atom> QgsLegendRenderer::createAtomList( QgsLayerTreeGr
208208

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

211+
// workaround for the issue that "filtering by map" does not remove layer nodes that have no symbols present
212+
// on the map. We explicitly skip such layers here. In future ideally that should be handled directly
213+
// in the layer tree model
214+
if ( legendNodes.isEmpty() && mLegendModel->legendFilterByMap() )
215+
continue;
216+
211217
QList<Atom> layerAtoms;
212218

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

0 commit comments

Comments
 (0)
Please sign in to comment.