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

Nyall Dawson nyall.dawson at gmail.com
Wed Nov 7 23:08:45 PST 2018


On Thu, 8 Nov 2018 at 17:02, Raymond Nijssen <r.nijssen at terglobo.nl> wrote:
>
> 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

item.isVisible()

It's from the base QGraphicsItem class.

Nyall


More information about the QGIS-Developer mailing list