with preset choices in processing GUI
In some circumstances it is desirable to restrict the values available
when a user is asked to enter a string parameter to a list of predetermined
"valid" values, yet these values will vary installation by installation
(e.g. a "printer name" parameter, where you want users to pick from
printers installed on the system, but since the printer names will
vary install to install an enum parameter is not a valid choice)
This can now be done by setting the widget wrapper metadata
"value_hints" option, as demonstrated below. (While this provides a mechanism
for guiding users to select from valid string values when running a Processing
algorithm through the GUI, it does not place any limits on the string values
accepted via PyQGIS codes or when running the algorithm via other non-gui
means. Algorithms should gracefully handle other values accordingly.)
param = QgsProcessingParameterString( 'PRINTER_NAME', 'Printer name')
# show only printers which are available on the current system as options
# for the string input.
param.setMetadata( {'widget_wrapper':
{ 'value_hints': ['Inkjet printer', 'Laser printer'] }
})
helpful comments next to all static enum parameter values used
in child algorithms with the corresponding text.
I.e. instead of
alg_params = {
'END_CAP_STYLE': 2,
}
we now export
alg_params = {
'END_CAP_STYLE': 2, # Flat
}
Much more readable!
add an explicit log level getter/setter to QgsProcessingContext which
algorithms can use to determine an appropriate level of feedback
to push to users.
Initially the verbose log only triggers the full verbose output
of model executions (which is also used when running models through
the model designer), but the intention is that more algorithms
will fine tune their output based on the logging level.
qgis_process also gains a new --verbose switch to enable verbose
log output.
Move vector, project and network related core .cpp/.h files into
dedicated subdirectories.
An attempt to organise src/core better to make things easier to find.
value of a parameter for the GUI only
This allows us freedom to change the default settings for an algorithm
shown when opening the algorithm in the toolbox/batch/model without
changing the underlying default value used for the parameter in the
raw API (which we can't do easily without potentially breaking 3rd
party scripts/plugins)
[processing] Infrastructure for QgsMeshLayer to add processing algorithms, dataset group paramater and dataset time parameter to allow the user to easily choose a dataset.
don't raise a generic "something went wrong" exception but instead
ensure that the original exception with the proper error message
is raised for catching in Python instead