Skip to content
Permalink
Browse files

Fix a Python error in Processing GUI

It turns out that an empty QComboBox evaluates to False:

>>> t=QLineEdit()
>>> bool(t)
True
>>> c=QComboBox()
>>> bool(c)
False

Due to that, the 'TABLE' parameter was missing if its (editable) combo box was empty.

Original error - while updating an algorithm's parameters (gdal:importvectorintopostgisdatabaseavailableconnections)

Traceback (most recent call last):
  File "/home/martin/qgis/git-master/build-debug/output/python/plugins/processing/algs/gdal/GdalAlgorithmDialog.py", line 121, in parametersHaveChanged
    or (not p.checkValueIsAcceptable(parameters[p.name()])):
KeyError: 'TABLE'
  • Loading branch information
wonder-sk committed Jun 22, 2018
1 parent 3f16335 commit 80b0c72c50f3edbe5037a6301a696b45f381aedc
Showing with 1 addition and 1 deletion.
  1. +1 −1 python/plugins/processing/gui/AlgorithmDialog.py
@@ -97,7 +97,7 @@ def getParameterValues(self):
if not param.isDestination():
wrapper = self.mainWidget().wrappers[param.name()]
value = None
if wrapper.widget:
if wrapper.widget is not None:
value = wrapper.value()
parameters[param.name()] = value

0 comments on commit 80b0c72

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