1

When I run a treatment inside QGIS with Processing toolbox (native algorithms) I get a progression bar :

enter image description here

Is there a way to use this percentage inside a standalone PyQGIS script? I searched in the description of processing.run() but it seems nothing is linking to this progression bar.

3

Yes - processing.run accepts a "feedback" argument, which must be an instance of a QgsProcessingFeedback subclass.

If you construct your own feedback object to pass to this function, you can connect to the progressChanged signal and handle progress reports:

def progress_changed(progress):
    print(progress)

f = QgsProcessingFeedback()
f.progressChanged.connect(progress_changed)
processing.run(...., feedback=f)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.