[QGIS-Developer] Questions regarding the QgsProcessingAlgorithm class
Ujaval Gandhi
ujaval at spatialthoughts.com
Fri Nov 24 03:21:31 PST 2023
Some ideas inline below
[data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=3D]
On Thu, Nov 23, 2023 at 4:33 PM Bo Victor Thomsen via QGIS-Developer
<qgis-developer at lists.osgeo.org [qgis-developer at lists.osgeo.org]> wrote:
> Hi list -
>
>
> I apologize for the cross-posting to this mailing list from qgis-user. But I
> hope, that somebody has the answers to the questions...
>
>
> I have a couple of (probably dumb) questions on how to use the
> "QgsProcessingAlgorithm" class.
>
> * A have a lot parameter inputs placed in the "advanced" section af the
> processing input dialog. It's parameters that seldom has to be changed.
> How do I present the "Avanced" section not unfolded? The default is to
> unfold this section and thus possibly confuse users by showing a lot of
> seldom changed parameters.
>
>
This behavior seems to be controlled on the user side and is sticky. In my QGIS
install, when I collapse the 'Advanced' section in an algorithm, all subsequent
algorithms have that section collapsed. There must be a setting that you
can probably toggle via PyQGIS. Maybe someone else here knows.
> *
> * One of my input parameters is a "QgsProcessingParameterString" parameter
> that will contain a password.
> Can I obfuscate the parameter input, i.e showing '*******' instead of the
> password ?
>
>
This is generally discouraged in favor of using the Auth manager. Could you
store the password there and retrieve it in your script?
> *
> * the "QgsProcessingParameterFeatureSource" method creates a drop-down with
> names of layers in the map and a checkbox with the label "Selected features
> only". Is it possible to set the checkmark automatically when showing the
> processing userdialog ? And how ??
I don't think this is possible. As a workaround, if you always want to use
selected features when available, you can use QgsProcessingParameterVectorLayer
input instead, check if there are selected layers when processing it and get
only selected features.
> *
>
>
> --
> Med venlig hilsen / Best regards
>
> Bo Victor Thomsen
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org [QGIS-Developer at lists.osgeo.org]
> List info: 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]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20231124/906ad8d8/attachment.htm>
More information about the QGIS-Developer
mailing list