Feature request #2672
Set group/layer visibility and expansion state in QgsLegendInterface
|Pull Request or Patch supplied:||Resolution:||fixed|
|Easy fix?:||No||Copied to github as #:||12732|
Would be nice to set group and/or layer visibility (check state) and expansion state in QgsLegendInterface. I just need it for my plugin, but I thought maybe somebody else could use it someday.
#1 Updated by Martin Dobias over 11 years ago
thanks for the patch. I have some suggestions for improvement of the patch in order to commit it:
- setItemVisible works with both groups and layers, but only on top level. It would be better to split the functionality into two functions, e.g. setGroupVisible and setLayerVisible - where groups would be identified by the index, layers by the pointer to QgsMapLayer to keep the API consistent
- the "setter" functions should get also appropriate "getter" function to query the state, e.g. for setGroupExpanded there should be a function isGroupExpanded.
Looking forward to see the improved patch,