<div dir="ltr">Thanks guys,<div><br></div><div>I solved my problem</div><div><br></div><div>In particular it was the feedback.progressChanged.connect suggested by German the missing part.</div><div>Cheers</div><div>Pierluigi</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno mar 20 lug 2021 alle ore 15:20 Germán Carrillo <<a href="mailto:carrillo.german@gmail.com">carrillo.german@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Hi Pierluigi, <div><br></div><div><br></div><div>you need to create your own <i>feedback</i> object and connect its <i>progressChanged</i> SIGNAL to your progressbar's <i>setValue</i> SLOT, in this way:</div><div><br></div><div><br></div><div>feedback = QgsProcessingFeedback()<br>feedback.progressChanged.connect(<span style="color:rgb(0,0,0)">progressBarGrid</span>.setValue)<br><br>params_creategrid = {</div><div>    # Set key-value parameters</div><div>}</div></div><div>result_grid = processing.run("native:creategrid", params_creategrid, feedback=feedback)<br></div><div><br></div><div><br></div><div>Source: <a href="https://gis.stackexchange.com/a/348588/4972" target="_blank">https://gis.stackexchange.com/a/348588/4972</a></div><div><br></div><div><br></div><div>Regards, </div><div><br></div><div>Germán</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El mar, 20 jul 2021 a las 4:52, matteo (<<a href="mailto:matteo.ghetta@gmail.com" target="_blank">matteo.ghetta@gmail.com</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Pierluigi,<br>
<br>
<br>
> can you please explain me better?<br>
> I have self plugin that in particular part use this code<br>
> <br>
> result_grid = processing.run("native:creategrid", params_creategrid)<br>
<br>
as explained by Prem, if you want to add the progress when you call a <br>
"native" algorithm of QGIS within your algorithm, then you can pass to <br>
the algorithm parameters:<br>
<br>
result_grid = processing.run("native:creategrid", params_creategrid, <br>
context=context, feedback=feedback)<br>
<br>
be aware also at the `is_child` parameter. Have a look at the example:<br>
<br>
<a href="https://docs.qgis.org/3.4/en/docs/user_manual/processing/scripts.html#extending-qgsprocessingalgorithm" rel="noreferrer" target="_blank">https://docs.qgis.org/3.4/en/docs/user_manual/processing/scripts.html#extending-qgsprocessingalgorithm</a><br>
<br>
if you want to add steps to the progressBar with your logic then you can <br>
use feedback.setProgress(number) to fill the progress bar. Have a look <br>
at the template script and you will find a fine usage<br>
<br>
Hope this helps<br>
<br>
Matteo<br>
_______________________________________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">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/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>-----------<br></div><div>   |\__  <br>(:>__)(<br>   |/    <br>Soluciones Geoinformáticas Libres                            <br><a href="http://geotux.tuxfamily.org/" target="_blank">http://geotux.tuxfamily.org/</a><br><a href="http://twitter.com/GeoTux2" target="_blank">https://twitter.com/GeoTux2</a></div><div><br></div><div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Ing. Pierluigi De Rosa (PhD in Earth Science)</div><div dir="ltr">Contract Professor of Geographic Information System at University of Perugia<br>cel: 349755826<span><span dir="ltr">8</span></span> / fax: 075 7823038<br>skype: pierluigi.derosa </div></div></div></div></div></div>