Skip to content

Commit

Permalink
use setValue() instead of setLayer() to handle different value types
Browse files Browse the repository at this point in the history
(strings, variants, layers)
  • Loading branch information
alexbruy authored and nyalldawson committed Dec 10, 2019
1 parent dcdcb33 commit 243cd6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/plugins/processing/gui/wrappers.py
Expand Up @@ -937,10 +937,10 @@ def createWidget(self):

try:
if self.parameterDefinition().flags() & QgsProcessingParameterDefinition.FlagOptional:
self.combo.setLayer(self.parameterDefinition().defaultValue())
self.combo.setValue(self.parameterDefinition().defaultValue(), self.context)
else:
if self.parameterDefinition().defaultValue():
self.combo.setLayer(self.parameterDefinition().defaultValue())
self.combo.setvalue(self.parameterDefinition().defaultValue(), self.context)
else:
self.combo.setLayer(iface.activeLayer())
except:
Expand Down

0 comments on commit 243cd6c

Please sign in to comment.