Skip to content
Permalink
Browse files

Add some notes about porting field parameters

  • Loading branch information
nyalldawson committed Jul 15, 2017
1 parent 830ad0b commit 9bf8fb042cdf4ceb794966b53387681ae426fed0
Showing with 6 additions and 1 deletion.
  1. +6 −1 doc/porting_processing.dox
@@ -9,7 +9,12 @@

- Input parameters and available outputs must be declared in an implementation of the new pure virtual method initAlgorithm(self, config={})

- The input parameters and outputs classes have been replaced with new c++ versions, which must be used when calling addParameter and addOuput.
- The input parameters and outputs classes have been replaced with new c++ versions, which must be used when calling addParameter and addOuput.

- ParameterField has been replaced with QgsProcessingParameterField.
- When constructing, QgsProcessingParameterField uses QgsProcessingParameterField.DataType to specify valid data types. The parent layer for the field should be indicated by passing the parent layer parameter name as the parentLayerParameterName argument in the constructor.
- Retrieving field parameter values should be done with self.parameterAsString( parameters, PARAM_NAME, context) for single field values or self.parameterAsFields(parameters, PARAM_NAME, context) if allowMultiple was set to True when the parameter was constructed. parameterAsFields will return a list of all select field names, or an empty list if no fields were selected.

Map parameters from old classes to new classes
- ParameterNumber -> QgsProcessingParameterNumber
- constructor arguments in different order

0 comments on commit 9bf8fb0

Please sign in to comment.
You can’t perform that action at this time.