mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-18 00:03:05 -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:
|
except KeyError:
|
||||||
continue
|
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):
|
if issubclass(wrapper.__class__, WidgetWrapper):
|
||||||
widget = wrapper.widget
|
widget = wrapper.widget
|
||||||
else:
|
else:
|
||||||
|
@ -234,6 +234,10 @@ class BatchPanel(BASE, WIDGET):
|
|||||||
def setCellWrapper(self, row, column, wrapper, context):
|
def setCellWrapper(self, row, column, wrapper, context):
|
||||||
self.wrappers[row][column] = wrapper
|
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)
|
is_cpp_wrapper = not issubclass(wrapper.__class__, WidgetWrapper)
|
||||||
if is_cpp_wrapper:
|
if is_cpp_wrapper:
|
||||||
widget = wrapper.createWrappedWidget(context)
|
widget = wrapper.createWrappedWidget(context)
|
||||||
|
@ -131,6 +131,11 @@ class ParametersPanel(BASE, WIDGET):
|
|||||||
else:
|
else:
|
||||||
wrapper = WidgetWrapperFactory.create_wrapper(param, self.parent)
|
wrapper = WidgetWrapperFactory.create_wrapper(param, self.parent)
|
||||||
self.wrappers[param.name()] = wrapper
|
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)
|
is_python_wrapper = issubclass(wrapper.__class__, WidgetWrapper)
|
||||||
if not is_python_wrapper:
|
if not is_python_wrapper:
|
||||||
widget = wrapper.createWrappedWidget(self.processing_context)
|
widget = wrapper.createWrappedWidget(self.processing_context)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user