I'm trying to set programmatically a QgsComposerPicture content in QGIS2.99:
1) I create a new print composition and I name it 'test'
2) I create a picture frame in the composition and I call it 'picture'
3) I run the following code:
from qgis.core import QgsProject
myComposition =
QgsProject.instance().layoutManager().compositionByName('test')
myComposerPicture = myComposition.getComposerItemById("picture")
myComposerPicture.setPicturePath("[path to an image]")
and I get the following Exception:
AttributeError: 'QgsComposerItem' object has no attribute 'setPicturePath'
If I inspect myComposerPicture object I found it is a
qgis._core.QgsComposerItem not a QgsComposerPicture
Is this a correct behaviour or is it an issue?
Should I open a issue ticket?
_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer