[QGIS-Developer] createAlgorithmDialog in Processing script (within plugin)

matteo matteo.ghetta at gmail.com
Tue Feb 21 07:41:30 PST 2023


Hi devs,

I'm raising this email again because I don't know if this a 
bug/limitation/correct behavior.

I also think that the problem is from a thread point of view, at least 
by the crash that I have.

Knowing that a processing algorithm, as suggested by Germàn, can be 
created with:

processing.createAlgorithmDialog("my_provider:my_algorithm", params)

within a plugin, if the algorithm **id** is passed as first argument, 
QGIS is crashing, while it seems working on a standalone script in the 
QGIS code editor.

Is this a limitation?

Cheers and thanks for any suggestion!

Matteo

On 8/1/22 15:23, matteo wrote:
> Hi all,
> 
> I've a set of custom processing scripts within a plugin (that is both 
> "normal" and processing provider plugin).
> 
> I'm trying to executing the dialog of these algorithm from one of the 
> main plugin file. I found the processing.createAlgorithmDialog [0], but 
> it is constantly crashing when I'm passing the instance of the algorithm:
> 
> my_alg = MyCustomAlg()
> my_dialog = my_alg.createAlgorithmDialog(custom_dict)
> 
> ## crash here
> 
> Thinking it was a problem of the threads I also tried to overwrite the 
> `flag` method in the algorithm by setting also 
> QgsProcessingAlgorithm.FlagNoThreading but with the same results.
> 
> I know I can run the processing algorithm with processing.run(....) but 
> I need to open the dialog pre-filled with custom parameters and to get 
> also some other outputs besides the standard ones (like the 
> QgsFeatureSink path)
> 
> Thanks for any suggestion
> 
> Cheers
> 
> Matteo
> 
> 
> [0] 
> https://github.com/qgis/QGIS/blob/master/python/plugins/processing/tools/general.py#L155
> 


More information about the QGIS-Developer mailing list