mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-15 00:07:25 -05:00
[processing] Fix models cannot correctly set enum parameters
to a static choice
This commit is contained in:
parent
84163841df
commit
6b5e5b6ed5
@ -984,6 +984,10 @@ class EnumWidgetWrapper(WidgetWrapper):
|
||||
return widget
|
||||
else:
|
||||
self.combobox = QComboBox()
|
||||
if self.param.flags() & QgsProcessingParameterDefinition.FlagOptional:
|
||||
self.combo.addItem(self.NOT_SELECTED, self.NOT_SET_OPTION)
|
||||
for i, option in enumerate(self.param.options()):
|
||||
self.combobox.addItem(option, i)
|
||||
values = self.dialog.getAvailableValuesOfType(QgsProcessingParameterEnum)
|
||||
for v in values:
|
||||
self.combobox.addItem(self.dialog.resolveValueDescription(v), v)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user