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)

(cherry picked from commit 243cd6c)
  • Loading branch information
alexbruy authored and nyalldawson committed Dec 11, 2019
1 parent 59a50a5 commit cad3aba
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 cad3aba

Please sign in to comment.