[QGIS-Developer] Several Processing Plugin Questions

C Hamilton adenaculture at gmail.com
Fri Jun 29 06:37:17 PDT 2018


Nyall,

Thanks so much. It works.

Calvin

On Thu, Jun 28, 2018 at 7:11 PM, Nyall Dawson <nyall.dawson at gmail.com>
wrote:

> On Fri, 29 Jun 2018 at 01:52, C Hamilton <adenaculture at gmail.com> wrote:
> >
> > 1. For the QgsProcessingAlgorithm you define 'name', 'displayName',
> 'group', and 'groupId'. The group creates a sub folder within my processing
> toolbox. What if I don't want a group sub folder within my toolbox. How do
> I have the algorithm on the first level?
>
> That's not possible in <=3.2. I'm refactoring the toolbox currently,
> I'll add support for this for 3.4.
>
> > 2. I am working on this for Shape Tools and not all the tools will be
> processing algorithms. I would like to be able to call the processing
> algorithm from my Shape Tools menu. I see no reason to programmatically
> create two interfaces for the algorithm. How can I launch the processing
> algorithm from the menu.
>
> Call either
>
>     # populate with parameters you want to show in the dialog, if you
> want non-default values
>     initial_parameters = {}
>     results = processing.execAlgorithmDialog('qgis:buffer',
> initial_parameters)
>
> Or
>
>     # populate with parameters you want to show in the dialog, if you
> want non-default values
>     initial_parameters = {}
>     dlg =  processing.createAlgorithmDialog('qgis:buffer',
> initial_parameters)
>     # do something with dlg
>
> The difference is that execAlgorithmDialog handles automatically
> showing the dialog and return the algorithm results, while
> createAlgorithmDialog leaves it up to you to show and execute the
> dialog and retrieve the results.
>
> Nyall
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180629/46c4555a/attachment.html>


More information about the QGIS-Developer mailing list