Skip to content
Permalink
Browse files

fix reference to widget as instance attribute not through a method

  • Loading branch information
luipir authored and nyalldawson committed Sep 7, 2018
1 parent 3ad3fc4 commit 95a4c005840a6ed6b60377323c0be52a609d5dc4
Showing with 7 additions and 7 deletions.
  1. +7 −7 python/plugins/processing/algs/qgis/ui/RasterCalculatorWidgets.py
@@ -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):
@@ -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.
You can’t perform that action at this time.