[QGIS-Developer] Has QgsLayout.itemById() changed?

Raymond Nijssen r.nijssen at terglobo.nl
Fri Sep 21 06:20:00 PDT 2018


Running this python script (in qgis 3.3):

p = QgsProject.instance()
lom = p.layoutManager()
lo = lom.layoutByName('a4')
item = lo.itemById('label_title')
print(item)


a few weeks ago, it outputed this:
<qgis._core.QgsLayoutItemLabel object at 0x7fe90b6d0318>


but today it outputs:
<qgis._core.QgsLayoutItem object at 0x7fe90b6d0318>



My next line is:

item.setText('hello')

which doesn't work anymore, because there is no setText() function on a 
QgsLayoutItem. Has anything changed recently? Does any one know a solution?

Regards,
Raymond


More information about the QGIS-Developer mailing list