I couldn't find anything about this problem.
Suppose to have the first parameters in a Processing script defined as an Enum
:
self.addParameter(
QgsProcessingParameterEnum(
self.CHOICE,
self.tr('Choose the parameter'),
['param1', 'param2']
)
)
While the second one as a number:
self.addParameter(
QgsProcessingParameterNumber(
name=self.VALUE,
description=self.tr('My value'),
type=QgsProcessingParameterNumber.Double,
defaultValue=40,
optional=False,
minValue=0,
maxValue=100
)
)
Is it possible to change the minValue, maxValue, description, ecc.. of the second parameter depending on the first or second choice of the first parameter already in the GUI?
e.g. if the user choose param1
then the second parameter should become:
self.addParameter(
QgsProcessingParameterNumber(
name=self.VALUE,
description=self.tr('My value'),
type=QgsProcessingParameterNumber.Double,
defaultValue=40,
optional=False,
minValue=0,
maxValue=100
)
)
while if he choose param2
it should became:
self.addParameter(
QgsProcessingParameterNumber(
name=self.VALUE,
description=self.tr('My AWESOME value'),
type=QgsProcessingParameterNumber.Double,
defaultValue=0,
optional=False,
minValue=50,
maxValue=500
)
)
Hoping to explain the problem right.
Thanks to all