<div dir="ltr"><div><div><div><div><div><div>I'm trying to set programmatically a QgsComposerPicture content in QGIS2.99:</div><div><br></div><div>1) I create a new print composition and I name it 'test'<br></div>2) I create a picture frame in the composition and I call it 'picture'<br></div>3) I run the following code:<br><br>from qgis.core import QgsProject<br>myComposition = QgsProject.instance().layoutManager().compositionByName('test')<br>myComposerPicture = myComposition.getComposerItemById("picture")<br>myComposerPicture.setPicturePath("[path to an image]")<br><br></div>and I get the following Exception:<br>AttributeError: 'QgsComposerItem' object has no attribute 'setPicturePath'<br><br></div>If I inspect myComposerPicture object I found it is a qgis._core.QgsComposerItem not a QgsComposerPicture<br><br></div>Is this a correct behaviour or is it an issue?<br></div>Should I open a issue ticket?<br><div><div><br></div></div></div>