Skip to content
Permalink
Browse files

Fix setting default value for non-multiple enum params

  • Loading branch information
nyalldawson committed May 11, 2018
1 parent 26a97a7 commit e35d1d0ed9ea527f79395681cf26d6521bfcc255
Showing with 4 additions and 1 deletion.
  1. +4 −1 python/plugins/processing/gui/enummodelerwidget.py
@@ -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

@@ -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:

0 comments on commit e35d1d0

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