mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
Add some notes on deprecated class handling
This commit is contained in:
parent
e76b761dd0
commit
3c2499ba95
@ -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:
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user