Skip to content
Browse files
Add 'not selected' option for optional layer parameters in processing…
… model view

Fixes #19329 (

Optional layer parameters in processing algorithms used in the graphical modeler
add an empty string as the default parameter value, which can raise an exception
during algorithm execution. This update replaces the default empty string with a
default 'Not selected' option.
  • Loading branch information
rudivs committed Jul 4, 2018
1 parent 7b751cb commit 57fb4ef27c89e89c5ce4ecb5b065d198f305d731
Showing 1 changed file with 2 additions and 2 deletions.
@@ -864,10 +864,10 @@ def createWidget(self):
self.combo = QComboBox()
layers = self.getAvailableLayers()
if self.param.flags() & QgsProcessingParameterDefinition.FlagOptional:
self.combo.addItem(self.NOT_SELECTED, self.NOT_SET_OPTION)
for layer in layers:
self.combo.addItem(self.dialog.resolveValueDescription(layer), layer)
if self.param.flags() & QgsProcessingParameterDefinition.FlagOptional:

widget = QWidget()
layout = QHBoxLayout()

0 comments on commit 57fb4ef

Please sign in to comment.