[QGIS-Developer] get visibility from layout items with python

Raymond Nijssen r.nijssen at terglobo.nl
Wed Nov 7 23:02:41 PST 2018


In the python api, QgsLayoutItems have a setter for the visibility, but 
i cannot find a way to retrieve the visibility setting.

https://qgis.org/pyqgis/master/core/Layout/QgsLayoutItem.html


I would like to do this:

item = QgsLayoutItemLabel() # I get this from my layout
checkbox.setChecked(item.visibility()) # this fails

and later:

item.setVisibility(checkbox.checked()) # this works


Is this possible in another way? Or is it just missing and can it be added?

Thanks,
Raymond


More information about the QGIS-Developer mailing list