Skip to content
Permalink
Browse files

[processing] fix handling of the multiple enum values

  • Loading branch information
alexbruy authored and nyalldawson committed May 7, 2018
1 parent 33cfed2 commit 39456ba6b4ae0d9642ec1b7854a1e47549e50b5a
@@ -83,13 +83,14 @@ def options(self):

return items

def defaultOption(self):
def defaultOptions(self):
options = []
model = self.lstItems.model()
for i in range(model.rowCount()):
item = model.item(i)
if item.checkState() == Qt.Checked:
return i
return None
options.append(i)
return options if len(options) > 0 else None

def allowMultiple(self):
return self.chkAllowMultiple.isChecked()
@@ -421,7 +421,7 @@ def accept(self):
self.param = QgsProcessingParameterCrs(name, description, self.selector.crs().authid())
elif (self.paramType == parameters.PARAMETER_ENUM or
isinstance(self.param, QgsProcessingParameterEnum)):
self.param = QgsProcessingParameterEnum(name, description, self.widget.options(), self.widget.allowMultiple(), self.widget.defaultOption())
self.param = QgsProcessingParameterEnum(name, description, self.widget.options(), self.widget.allowMultiple(), self.widget.defaultOptions())
elif (self.paramType == parameters.PARAMETER_MATRIX or
isinstance(self.param, QgsProcessingParameterMatrix)):
self.param = QgsProcessingParameterMatrix(name, description, hasFixedNumberRows=self.widget.fixedRows(), headers=self.widget.headers(), defaultValue=self.widget.value())

0 comments on commit 39456ba

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