[prev in list] [next in list] [prev in thread] [next in thread] 

List:       qgis-developer
Subject:    Re: [QGIS-Developer] createAlgorithmDialog in Processing script (within plugin)
From:       matteo via QGIS-Developer <qgis-developer () lists ! osgeo ! org>
Date:       2022-08-12 12:15:48
Message-ID: 896172ba-b5e5-0045-1844-6fbaec41f034 () gmail ! com
[Download RAW message or body]

Hi Germàn,


> If you want and if you have the time, we could have a look at this issue 
> at the QGIS Contributors Meeting in Firenze :)

that's great, see you very soon!

Cheers!

Matteo
> 
> Regards!
> 
> Germán
> 
> 
> El lun, 1 ago 2022 a las 17:07, matteo (<matteo.ghetta@gmail.com 
> <mailto:matteo.ghetta@gmail.com>>) escribió:
> 
> Hi German,
> 
> yes in your way it is working. But what if you try not with the
> algorithm/model id, but with an instance of the algorithm?
> 
> In the docs I read "Either an instance of an algorithm, or an
> algorithm's ID", therefore I'm trying to set up an instance of my
> algorithm and then passing it to the method
> 
> Cheers and thanks
> 
> Matteo
> 
> On 8/1/22 16:17, Germán Carrillo wrote:
> > Hi Matteo,
> > 
> > I've been successfully using /execAlgorithmDialog()/ instead [0]:
> > 
> > /processing.execAlgorithmDialog("my_provider:my_algorithm", params)/
> > 
> > where, /params/ is a dict with the pre-filled values you have.
> You can
> > see an example at [1].
> > 
> > Regards,
> > 
> > Germán
> > -----------
> > [0]
> > 
> https://github.com/qgis/QGIS/blob/2d1aa68f0d044f2aced7ebeca8d2fa6b754ac970/python/plugins/processing/tools/general.py#L185 \
> <https://github.com/qgis/QGIS/blob/2d1aa68f0d044f2aced7ebeca8d2fa6b754ac970/python/plugins/processing/tools/general.py#L185> \
> <https://github.com/qgis/QGIS/blob/2d1aa68f0d044f2aced7ebeca8d2fa6b754ac970/python/plugins/processing/tools/general.py#L185 \
> <https://github.com/qgis/QGIS/blob/2d1aa68f0d044f2aced7ebeca8d2fa6b754ac970/python/plugins/processing/tools/general.py#L185>>
> 
> > [1]
> > 
> https://github.com/SwissTierrasColombia/LADM-COL-Add-on-Ambiente/blob/master/ladm_col_environment_add_on.py#L140 \
> <https://github.com/SwissTierrasColombia/LADM-COL-Add-on-Ambiente/blob/master/ladm_col_environment_add_on.py#L140> \
> <https://github.com/SwissTierrasColombia/LADM-COL-Add-on-Ambiente/blob/master/ladm_col_environment_add_on.py#L140 \
> <https://github.com/SwissTierrasColombia/LADM-COL-Add-on-Ambiente/blob/master/ladm_col_environment_add_on.py#L140>>
> 
> > 
> > 
> > El lun, 1 ago 2022 a las 15:23, matteo via QGIS-Developer
> > (<qgis-developer@lists.osgeo.org
> <mailto:qgis-developer@lists.osgeo.org>
> > <mailto:qgis-developer@lists.osgeo.org
> <mailto:qgis-developer@lists.osgeo.org>>>) escribió:
> > 
> > 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 \
> <https://github.com/qgis/QGIS/blob/master/python/plugins/processing/tools/general.py#L155> \
> <https://github.com/qgis/QGIS/blob/master/python/plugins/processing/tools/general.py#L155 \
> <https://github.com/qgis/QGIS/blob/master/python/plugins/processing/tools/general.py#L155>>
> 
> > 
> > _______________________________________________
> > QGIS-Developer mailing list
> > QGIS-Developer@lists.osgeo.org
> <mailto:QGIS-Developer@lists.osgeo.org>
> <mailto:QGIS-Developer@lists.osgeo.org
> <mailto:QGIS-Developer@lists.osgeo.org>>
> > List info:
> https://lists.osgeo.org/mailman/listinfo/qgis-developer
> <https://lists.osgeo.org/mailman/listinfo/qgis-developer>
> > <https://lists.osgeo.org/mailman/listinfo/qgis-developer
> <https://lists.osgeo.org/mailman/listinfo/qgis-developer>>
> > Unsubscribe:
> https://lists.osgeo.org/mailman/listinfo/qgis-developer
> <https://lists.osgeo.org/mailman/listinfo/qgis-developer>
> > <https://lists.osgeo.org/mailman/listinfo/qgis-developer
> <https://lists.osgeo.org/mailman/listinfo/qgis-developer>>
> > 
> > 
> > 
> > --
> > -----------
> > > \__
> > (:>__)(
> > > /
> > Soluciones Geoinformáticas Libres
> > http://geotux.tuxfamily.org/ <http://geotux.tuxfamily.org/>
> <http://geotux.tuxfamily.org/ <http://geotux.tuxfamily.org/>>
> > https://twitter.com/GeoTux2 <https://twitter.com/GeoTux2>
> <http://twitter.com/GeoTux2 <http://twitter.com/GeoTux2>>
> > 
> > <http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo
> <http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>>
> 
> 
> 
> -- 
> -----------
> > \__
> (:>__)(
> > /
> Soluciones Geoinformáticas Libres
> http://geotux.tuxfamily.org/ <http://geotux.tuxfamily.org/>
> https://twitter.com/GeoTux2 <http://twitter.com/GeoTux2>
> 
> <http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic