[QGIS-Developer] pyqgis how set filter legend map content in layer panel
Enzo Cocca
enzo.ccc at gmail.com
Mon May 10 23:51:41 PDT 2021
Hi,
I'm speaking about this:
[image: 2021-05-11_08-48-53.jpg]
I want check it automatically when load an vector or using this on specific
layer
E
Il giorno mar 11 mag 2021 alle ore 08:41 Richard Duivenvoorde <
rdmailings at duif.net> ha scritto:
> On 5/11/21 12:04 AM, Enzo Cocca wrote:
> > Hi Alex,
> > Thanks for replay.
> > Im speaking about the legend into layer panel. I'm not understand if I
> can set the filter legend on map when load an view with a style into layer
> panel. Into layer panel exist an check toolbox for this and so i would
> activate it when load my view or better if possible set the filter just on
> specific vectors.
>
> Not sure, but you are talking about rule base styling, and you want to
> change the visibility of one of the 'rules' as if you check the class/rule
> in the Layer Manager (or in the Rulebased symbology panel)?
>
> If so: maybe you can do it via the layer tree api?
>
> https://www.lutraconsulting.co.uk/blog/2014/07/06/qgis-layer-tree-api-part-1/
>
> Find the specific node and enable/disable it?
>
> Another option is go into the symbology, find the Rule and disable it by
> using setActive?
>
> https://qgis.org/api/3.18/classQgsRuleBasedRenderer_1_1Rule.html#a8306b64ca0ad4371fce04f4297647d35
>
> But to be honest: I've no experience with it
>
> Regards,
>
> Richard Duivenvoorde
>
>
>
--
Enzo Cocca PhD
in "Science and Technology for Archaeology and Cultural Heritage"
ISMEO
International Association of Mediterranean and Oriental Studies
mail: enzo.ccc at gmail.com
cell: +393495087014
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20210511/db74e894/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2021-05-11_08-48-53.jpg
Type: image/jpeg
Size: 18992 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20210511/db74e894/attachment-0001.jpg>
More information about the QGIS-Developer
mailing list