<div dir="auto">Thanks Nyall, I will wait for that. </div><div class="gmail_extra"><br><div class="gmail_quote">Il 07/gen/2018 02:08, "Nyall Dawson" <<a href="mailto:nyall.dawson@gmail.com">nyall.dawson@gmail.com</a>> ha scritto:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 7 January 2018 at 08:13, Enrico Ferreguti <<a href="mailto:enricofer@gmail.com">enricofer@gmail.com</a>> wrote:<br>
> I'm trying to set programmatically a QgsComposerPicture content in QGIS2.99:<br>
><br>
> 1) I create a new print composition and I name it 'test'<br>
> 2) I create a picture frame in the composition and I call it 'picture'<br>
> 3) I run the following code:<br>
><br>
> from qgis.core import QgsProject<br>
> myComposition =<br>
> QgsProject.instance().<wbr>layoutManager().<wbr>compositionByName('test')<br>
> myComposerPicture = myComposition.<wbr>getComposerItemById("picture")<br>
> myComposerPicture.<wbr>setPicturePath("[path to an image]")<br>
><br>
> and I get the following Exception:<br>
> AttributeError: 'QgsComposerItem' object has no attribute 'setPicturePath'<br>
><br>
> If I inspect myComposerPicture object I found it is a<br>
> qgis._core.QgsComposerItem not a QgsComposerPicture<br>
><br>
> Is this a correct behaviour or is it an issue?<br>
> Should I open a issue ticket?<br>
<br>
If your script is targeting QGIS 3.0, please don't file bugs against<br>
composer. You need to use the newer layouts engine instead (QgsLayout<br>
and associated classes).<br>
<br>
Over the coming week all composer code will be removed from QGIS.<br>
<br>
Nyall<br>
<br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> QGIS-Developer mailing list<br>
> <a href="mailto:QGIS-Developer@lists.osgeo.org">QGIS-Developer@lists.osgeo.org</a><br>
> List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
> Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
</blockquote></div></div>