Skip to content
Permalink
Browse files

Make model editor dialog more robust while loading models

  • Loading branch information
nyalldawson committed Jul 8, 2017
1 parent 9d04f87 commit 0836c60712aa6b63814563c2f161231c685c4888
@@ -177,7 +177,10 @@ def setComboValue(self, value, combobox=None):
if combobox is None:
combobox = self.widget
if isinstance(value, list):
value = value[0]
if value:
value = value[0]
else:
value = None
values = [combobox.itemData(i) for i in range(combobox.count())]
try:
idx = values.index(value)
@@ -251,11 +251,14 @@ def setPreviousValues(self):
for param in alg.algorithm().parameterDefinitions():
if param.isDestination() or param.flags() & QgsProcessingParameterDefinition.FlagHidden:
continue
value = None
if param.name() in alg.parameterSources():
value = alg.parameterSources()[param.name()]
if isinstance(value, list) and len(value) == 1:
value = value[0]
else:
elif isinstance(value, list) and len(value) == 0:
value = None
if value is None:
value = param.defaultValue()

if isinstance(value, QgsProcessingModelAlgorithm.ChildParameterSource) and value.source() == QgsProcessingModelAlgorithm.ChildParameterSource.StaticValue:

0 comments on commit 0836c60

Please sign in to comment.
You can’t perform that action at this time.