Skip to content

Commit

Permalink
Fix setting default value for non-multiple enum params
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 11, 2018
1 parent 26a97a7 commit e35d1d0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/plugins/processing/gui/enummodelerwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ def defaultOptions(self):
for i in range(model.rowCount()):
item = model.item(i)
if item.checkState() == Qt.Checked:
if not self.allowMultiple():
return i
options.append(i)
return options if len(options) > 0 else None

Expand All @@ -134,7 +136,8 @@ def setOptions(self, options):

def setDefault(self, indexes):
model = self.lstItems.model()

if not isinstance(indexes, (list, tuple)):
indexes = [indexes]
for i in indexes:
item = model.item(i)
if item:
Expand Down

0 comments on commit e35d1d0

Please sign in to comment.