diff --git a/python/plugins/processing/gui/AlgorithmDialog.py b/python/plugins/processing/gui/AlgorithmDialog.py index 2107b1f50af..38b88d1c80e 100644 --- a/python/plugins/processing/gui/AlgorithmDialog.py +++ b/python/plugins/processing/gui/AlgorithmDialog.py @@ -104,6 +104,10 @@ class AlgorithmDialog(QgsProcessingAlgorithmDialogBase): except KeyError: continue + # For compatibility with 3.x API, we need to check whether the wrapper is + # the deprecated WidgetWrapper class. If not, it's the newer + # QgsAbstractProcessingParameterWidgetWrapper class + # TODO QGIS 4.0 - remove if issubclass(wrapper.__class__, WidgetWrapper): widget = wrapper.widget else: diff --git a/python/plugins/processing/gui/BatchPanel.py b/python/plugins/processing/gui/BatchPanel.py index 9431ec84ae7..f8dcd11c1da 100644 --- a/python/plugins/processing/gui/BatchPanel.py +++ b/python/plugins/processing/gui/BatchPanel.py @@ -234,6 +234,10 @@ class BatchPanel(BASE, WIDGET): def setCellWrapper(self, row, column, wrapper, context): self.wrappers[row][column] = wrapper + # For compatibility with 3.x API, we need to check whether the wrapper is + # the deprecated WidgetWrapper class. If not, it's the newer + # QgsAbstractProcessingParameterWidgetWrapper class + # TODO QGIS 4.0 - remove is_cpp_wrapper = not issubclass(wrapper.__class__, WidgetWrapper) if is_cpp_wrapper: widget = wrapper.createWrappedWidget(context) diff --git a/python/plugins/processing/gui/ParametersPanel.py b/python/plugins/processing/gui/ParametersPanel.py index 759dae79ff8..7dc38110851 100644 --- a/python/plugins/processing/gui/ParametersPanel.py +++ b/python/plugins/processing/gui/ParametersPanel.py @@ -131,6 +131,11 @@ class ParametersPanel(BASE, WIDGET): else: wrapper = WidgetWrapperFactory.create_wrapper(param, self.parent) self.wrappers[param.name()] = wrapper + + # For compatibility with 3.x API, we need to check whether the wrapper is + # the deprecated WidgetWrapper class. If not, it's the newer + # QgsAbstractProcessingParameterWidgetWrapper class + # TODO QGIS 4.0 - remove is_python_wrapper = issubclass(wrapper.__class__, WidgetWrapper) if not is_python_wrapper: widget = wrapper.createWrappedWidget(self.processing_context)