[QGIS-Developer] parameterAsEnumStrings always return default value
Nicolas Godet
nicolas.godet at outlook.fr
Fri Feb 24 05:27:30 PST 2023
I updated the snippet parameterAsEnumString return an empty value.
________________________________
De : QGIS-Developer <qgis-developer-bounces at lists.osgeo.org> de la part de Nicolas Godet via QGIS-Developer <qgis-developer at lists.osgeo.org>
Envoyé : vendredi 24 février 2023 14:11
À : qgis-developer at lists.osgeo.org <qgis-developer at lists.osgeo.org>
Objet : [QGIS-Developer] parameterAsEnumStrings always return default value
Dear devs,
I noticed in a custom alg that `parameterAsEnumStrings` always return the default value set in QgsProcessingParameterEnum.
Below a example alg to reproduce.
i prefere to start with an email before raising an issue as I could miss something
In alg window select any value different from 2023 (ex: 2020, index 3 in list).
Run alg
See info in log:
"""
Version de QGIS : 3.28.3-Firenze
Révision du code : c12bcb2f76c
Version de Qt : 5.15.3
Version de Python : 3.9.5
Version de GDAL : 3.6.2
Version de GEOS : 3.11.1-CAPI-1.17.1
Version de Proj : Rel. 9.1.1, December 1st, 2022
Version de PDAL : 2.4.3 (git-version: f8d673)
Algorithme commencé à: 2023-02-24T14:10:09
Démarrage de l'algorithme 'debug'…
Paramètres en entrée:
{ 'PARAMNAME' : 3 }
['2023', '2022', '2021', '2020']
[3]
2023
Execution completed in 0.02 secondes
Résultats :
{}
Chargement des couches de résultat
Algorithme 'debug' terminé
"""
Regards,
https://gitlab.nicodet.fr/-/snippets/10
[https://gitlab.nicodet.fr/assets/twitter_card-570ddb06edf56a2312253c5872489847a0f385112ddbcd71ccfa1570febab5d2.jpg]<https://gitlab.nicodet.fr/-/snippets/10>
Script debug parameterAsEnumStrings ($10) · Snippets · Snippets · GitLab<https://gitlab.nicodet.fr/-/snippets/10>
GitLab Community Edition
gitlab.nicodet.fr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20230224/a08cb7bf/attachment-0001.htm>
More information about the QGIS-Developer
mailing list