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 <[email protected]> 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 > [email protected] > List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer >
_______________________________________________ QGIS-Developer mailing list [email protected] List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
