Skip to content
Permalink
Browse files

Expression parameters don't have to have parent layers

  • Loading branch information
nyalldawson committed Nov 11, 2016
1 parent 132e76a commit 5625d6e9b6868de22b151313f446d1c44309017e
@@ -36,7 +36,7 @@

from qgis.core import QgsCoordinateReferenceSystem, QgsVectorLayer
from qgis.PyQt.QtWidgets import QCheckBox, QComboBox, QLineEdit, QPlainTextEdit
from qgis.gui import QgsFieldExpressionWidget
from qgis.gui import QgsFieldExpressionWidget, QgsExpressionLineEdit
from qgis.PyQt.QtCore import pyqtSignal, QObject, QVariant

from processing.gui.NumberInputPanel import NumberInputPanel
@@ -714,7 +714,10 @@ class ExpressionWidgetWrapper(WidgetWrapper):

def createWidget(self):
if self.dialogType in (DIALOG_STANDARD, DIALOG_BATCH):
widget = QgsFieldExpressionWidget()
if self.param.parent_layer:
widget = QgsFieldExpressionWidget()
else:
widget = QgsExpressionLineEdit()
if self.param.default:
widget.setExpression(self.param.default)
else:
@@ -210,7 +210,8 @@ def setupUi(self):

self.verticalLayout.addWidget(QLabel(self.tr('Parent layer')))
self.parentCombo = QComboBox()
idx = 0
self.parentCombo.addItem(self.tr("None"), None)
idx = 1
for param in list(self.alg.inputs.values()):
if isinstance(param.param, (ParameterVector, ParameterTable)):
self.parentCombo.addItem(param.param.description, param.param.name)

0 comments on commit 5625d6e

Please sign in to comment.