EnMAP-Box / enmap-box

EnMAP-Box source code repository. See https://enmap-box.readthedocs.io for documentation
GNU General Public License v3.0
39 stars 16 forks source link

Remove deprecated WidgetWrapper class #796

Open jakimowb opened 9 months ago

jakimowb commented 9 months ago

The WidgetWrapper class is deprecated and will be removed in future: qgis/python/plugins/processing/gui/ParametersPanel.py

# 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:
    widget = wrapper.wrappedWidget()

Let's remove it from the EnMAP-Box code and use proper QgsAbstractProcessingParameterWidgetWrapper implementations instead.

grafik

janzandr commented 9 months ago

Still not sure how to do that. Let's wait until the QGIS native algorithms, which are also still using the deprecated WidgetWrapper, have been transitioned. Currently, QGIS 4 is not planned anywhere soon, probably not even in the current project phase (till end 2026).

jakimowb commented 8 months ago

It just needs the implementation of a QgsProcessingParameterWidgetFactoryInterface `

Widget wrapper factories allow creation of QgsAbstractProcessingParameterWidgetWrapper objects. They are centrally managed by QgsProcessingGuiRegistry. Usually, individual factories are not directly utilized, rather the QgsGui.processingGuiRegistry()

`

janzandr commented 8 months ago

It just needs the implementation of a QgsProcessingParameterWidgetFactoryInterface

Can you prepare a minimalistic example?

jakimowb commented 8 months ago

Just read the QGIS docs, they are more or less self-explaining.