Bug report #11641
QgsComposerLegend.setLegendFilterByMapEnabled does not work for non-visible raster layers
|Affected QGIS version:||2.6.0||Regression?:||No|
|Operating System:||Windows||Easy fix?:||No|
|Pull Request or Patch supplied:||Yes||Resolution:||end of life|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||19894|
When a raster layer is loaded but visibility set to False (e.g. because a composer has a main map and an overview map, with the raster layer being required only for the overview map), QgsComposerLegend.setLegendFilterByMapEnabled(True) does not result in the raster layer being removed from the composer legend. Vector layers behave as expected - i.e. they are removed from the legend when the same process is applied. I understand that the method is also for limiting legend entries for vectors displayed with categorised styles, but I need a way to programmatically remove raster layers from the composer legend.
This is important for my organisation's several hundred QGIS users, most of them not highly skilled, as we create an automated map production Python plugin based on templates using a specific raster layer in the overview maps. The combination of this issue with part 2 of bug report #11293 means that I have not been able to use pyqgis to remove the raster layer from the composer legends - this may well mean we choose 2.4 rather than 2.6 for our imminent upgrade from 1.8.
#5 Updated by Giovanni Manghi over 1 year ago
- Resolution set to end of life
- Status changed from In Progress to Closed
End of life notice: QGIS 2.18 LTR