[QGIS-Developer] QGIS composer print layout
JD L
jdaniel.lomenede at gmail.com
Sat Jan 23 06:35:14 PST 2021
Hi Giulio,
add the flags methods to tell your algorithm is not thread-safe. From the
documentation :
https://docs.qgis.org/3.16/en/docs/user_manual/processing/scripts.html#flags
If your algorithm is regularly crashing, you are probably using API calls
which are not safe to do in a background thread. Try returning the
*QgsProcessingAlgorithm.FlagNoThreading
flag from your algorithm’s flags() method* to force Processing to run your
algorithm in the main thread instead.
I just tested and it works.
Regards,
Le ven. 22 janv. 2021 à 14:56, Giulio Fattori <giulio.fattori at tin.it> a
écrit :
> Hello,
> i'm developing a QGIS plugin algorithm that composes a print layout.
> The attached code works but the map window appears in the composer with
> the word "Rendering map".
> and I get these messages:
>
> WARNING QObject::connect: Cannot queue arguments of type
> 'QItemSelection'
> (Make sure 'QItemSelection' is registered using
> qRegisterMetaType().)
> WARNING QObject::connect: Cannot queue arguments of type
> 'QItemSelection'
> (Make sure 'QItemSelection' is registered using
> qRegisterMetaType().)
> WARNING QObject::connect: Cannot queue arguments of type
> 'QItemSelection'
> (Make sure 'QItemSelection' is registered using
> qRegisterMetaType().)
> WARNING QObject::startTimer: Timers cannot be started from another
> thread
>
> CRITICAL Qt : QObject::killTimer: Timers cannot be stopped from another
> thread
> CRITICAL Qt : QObject::startTimer: Timers cannot be started from
> another thread
> CRITICAL Qt : QObject::killTimer: Timers cannot be stopped from another
> thread
> CRITICAL Qt : QObject::startTimer: Timers can only be used with threads
> started with QThread
>
> Only after saving and reopening QGIS do I get the correct result in the
> composer.
>
> What is missing to make it work properly?
>
> Can someone help me?
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20210123/dd832e3b/attachment.html>
More information about the QGIS-Developer
mailing list