mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Do not show in composer legend unused layers if filtering by map is enabled
This resolves #11457 and partially #11293
This commit is contained in:
parent
6bde8a2015
commit
4ac94f2275
@ -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() )
|
||||
continue;
|
||||
|
||||
QList<Atom> layerAtoms;
|
||||
|
||||
for ( int j = 0; j < legendNodes.count(); j++ )
|
||||
|
Loading…
x
Reference in New Issue
Block a user