mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
[processing] more complete scope for expressions in outputs
This commit is contained in:
parent
7805c64208
commit
e9a3089670
@ -108,12 +108,18 @@ class OutputSelectionPanel(BASE, WIDGET):
|
||||
|
||||
def showExpressionsBuilder(self):
|
||||
context = QgsExpressionContext()
|
||||
context.appendScope(QgsExpressionContextUtils.projectScope())
|
||||
context.appendScope(QgsExpressionContextUtils.globalScope())
|
||||
scope = QgsExpressionContextUtils.projectScope()
|
||||
self.addVariablesToScope(scope)
|
||||
dlg = QgsExpressionBuilderDialog(None, self.leText.text(), self, "generic", context)
|
||||
dlg.setWindowTitle(self.tr("Expression based output"));
|
||||
if dlg.exec_() == QDialog.Accepted:
|
||||
self.leText.setText(dlg.expressionText())
|
||||
|
||||
def addVariablesToScope(self, scope):
|
||||
for param in self.ag.parameters:
|
||||
scope.setVariable("%s_value" % param.name, "")
|
||||
|
||||
def saveToTemporaryFile(self):
|
||||
self.leText.setText('')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user