Skip to content
Permalink
Browse files

[processing] correctly handle default params in modeler

  • Loading branch information
volaya committed Jan 18, 2016
1 parent 4c34871 commit 2b3cf83991ed258a9ae9358293850ef4e528a75e
Showing with 3 additions and 3 deletions.
  1. +3 −3 python/plugins/processing/modeler/ModelerParametersDialog.py
@@ -284,7 +284,7 @@ def getWidgetFromParameter(self, param):
elif isinstance(param, ParameterSelection):
item = QComboBox()
item.addItems(param.options)
item.setCurrentIndex(param.default)
item.setCurrentIndex(param.default or 1)
elif isinstance(param, ParameterFixedTable):
item = FixedTablePanel(param)
elif isinstance(param, ParameterRange):
@@ -303,13 +303,13 @@ def getWidgetFromParameter(self, param):
options = [(self.resolveValueDescription(s), s) for s in strings]
if param.multiline:
item = MultilineTextPanel(options)
item.setText(unicode(param.default))
item.setText(unicode(param.default or ""))
else:
item = QComboBox()
item.setEditable(True)
for desc, val in options:
item.addItem(desc, val)
item.setEditText(unicode(param.default))
item.setEditText(unicode(param.default or ""))
elif isinstance(param, ParameterTableField):
item = QComboBox()
item.setEditable(True)

0 comments on commit 2b3cf83

Please sign in to comment.
You can’t perform that action at this time.