Skip to content
Permalink
Browse files

[processing] consider min and max values for int values

  • Loading branch information
alexbruy committed Sep 22, 2013
1 parent f890449 commit 05a94811cae4cc3008f9cfd97d04b068167bc1c7
@@ -28,16 +28,16 @@

class NumberInputPanel(QtGui.QWidget):

def __init__(self, number, isInteger):
def __init__(self, number, minimum, maximum, isInteger):
super(NumberInputPanel, self).__init__(None)
self.horizontalLayout = QtGui.QHBoxLayout(self)
self.horizontalLayout.setSpacing(2)
self.horizontalLayout.setMargin(0)
self.isInteger = isInteger
if isInteger:
self.spin = QtGui.QSpinBox()
self.spin.setMaximum(1000000000)
self.spin.setMinimum(-1000000000)
self.spin.setMaximum(maximum)
self.spin.setMinimum(minimum)
self.spin.setValue(number)
self.horizontalLayout.addWidget(self.spin)
self.setLayout(self.horizontalLayout)
@@ -264,7 +264,7 @@ def getWidgetFromParameter(self, param):
opts.append(self.getExtendedLayerName(opt))
item = MultipleInputPanel(opts)
elif isinstance(param, ParameterNumber):
item = NumberInputPanel(param.default, param.isInteger)
item = NumberInputPanel(param.default, param.min, param.max, param.isInteger)
elif isinstance(param, ParameterExtent):
item = ExtentSelectionPanel(self.parent, self.alg, param.default)
elif isinstance(param, ParameterCrs):

0 comments on commit 05a9481

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