Skip to content
Permalink
Browse files

[processing] fixed expressions dialog when not in modeler

  • Loading branch information
volaya committed Oct 5, 2016
1 parent bc0cdc7 commit 2207669001928a06d01ddeb747bb6f0e285b8e89
Showing with 3 additions and 4 deletions.
  1. +3 −4 python/plugins/processing/gui/NumberInputPanel.py
@@ -66,6 +66,7 @@ def __init__(self, param, modelParametersDialog=None):

def showExpressionsBuilder(self):
context = self.param.expressionContext()
dlg = QgsExpressionBuilderDialog(None, self.leText.text(), self, 'generic', context)
if self.modelParametersDialog is not None:
context.popScope()
values = self.modelParametersDialog.getAvailableValuesOfType(ParameterNumber, OutputNumber)
@@ -102,10 +103,8 @@ def showExpressionsBuilder(self):
variables['%s_max' % name] = "Maximum value of %s" % desc
variables['%s_avg' % name] = "Mean value of %s" % desc
variables['%s_stddev' % name] = "Standard deviation of %s" % desc

dlg = QgsExpressionBuilderDialog(None, self.leText.text(), self, 'generic', context)
for variable, desc in list(variables.items()):
dlg.expressionBuilder().registerItem("Modeler", variable, "@" + variable, desc, highlightedItem=True)
for variable, desc in variables.iteritems():
dlg.expressionBuilder().registerItem("Modeler", variable, "@" + variable, desc, highlightedItem=True)
dlg.setWindowTitle(self.tr('Expression based input'))
if dlg.exec_() == QDialog.Accepted:
exp = QgsExpression(dlg.expressionText())

0 comments on commit 2207669

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