Skip to content

Commit

Permalink
fix reference to widget as instance attribute not through a method
Browse files Browse the repository at this point in the history
  • Loading branch information
luipir authored and nyalldawson committed Sep 7, 2018
1 parent 3ad3fc4 commit 95a4c00
Showing 1 changed file with 7 additions and 7 deletions.
Expand Up @@ -224,23 +224,23 @@ def refresh(self):
for lyr in layers:
for n in range(lyr.bandCount()):
options[lyr.name()] = '{:s}@{:d}'.format(lyr.name(), n + 1)
self.widget().setList(options)
self.widget.setList(options)

def setValue(self, value):
if self.dialogType == DIALOG_STANDARD:
pass # TODO
elif self.dialogType == DIALOG_BATCH:
return self.widget().setText(value)
return self.widget.setText(value)
else:
self.widget().setValue(value)
self.widget.setValue(value)

def value(self):
if self.dialogType in DIALOG_STANDARD:
return self.widget().value()
return self.widget.value()
elif self.dialogType == DIALOG_BATCH:
return self.widget().text()
return self.widget.text()
else:
return self.widget().value()
return self.widget.value()


class LayersListWidgetWrapper(WidgetWrapper):
Expand Down Expand Up @@ -273,7 +273,7 @@ def value(self):
return self.widget.getText()
else:
options = self._getOptions()
values = [options[i] for i in self.widget().selectedoptions]
values = [options[i] for i in self.widget.selectedoptions]
if len(values) == 0 and not self.parameterDefinition().flags() & QgsProcessingParameterDefinition.FlagOptional:
raise InvalidParameterValue()
return values

0 comments on commit 95a4c00

Please sign in to comment.