[Qgis-user] Access to iface in processing alg

Jean-Baptiste Desbas jb.desbas at gmail.com
Tue Jul 10 04:42:32 PDT 2018


Thanks to you two,

I didn't realize that it can cause other troubles.. So I will continue to
use pushInfo/repportError !

Regards,

2018-07-10 2:56 GMT+02:00 Nyall Dawson <nyall.dawson at gmail.com>:

> On Tue, 10 Jul 2018 at 05:15, Jean-Baptiste Desbas <jb.desbas at gmail.com>
> wrote:
> >
> >
> > Hi,
> >
> > I just want to display a messageBar instead of displaying it un the
> processing output console (feedback.pushInfo) It's ni big deal but i was
> just confused.
>
> As Matthias has said -- don't do this! Apart from the crashes, it will
> also break use of your algorithms from standalone scripts, where iface
> is not available. It also means the output is not properly logged, so
> users who want to save the log from model execution for later
> reference won't have these messages included.
>
> > Do toi have any tips of use case of the differents pushInfo,
> pushConsoleInfo, etc. ?
>
> Basically you can stick to pushInfo and reportError. Use pushInfo for
> informative messages, such as "Building spatial index" or "Found 56
> matching features", and reportError for... errors... e.g. "Feature
> does not have a point geometry, skipping".
>
> Nyall
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20180710/85616680/attachment.html>


More information about the Qgis-user mailing list