Skip to content

Commit

Permalink
[processing] Fix models cannot correctly set enum parameters
Browse files Browse the repository at this point in the history
to a static choice
  • Loading branch information
nyalldawson committed May 21, 2018
1 parent 8416384 commit 6b5e5b6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/plugins/processing/gui/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,10 @@ def createWidget(self, useCheckBoxes=False, columns=1):
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)
Expand Down

0 comments on commit 6b5e5b6

Please sign in to comment.