data defined buttons for model child algorithms
The context was not previously exposed, so users would not have
been aware that they can utilise all the variables and functions
available to parameters within child algorithms.
A new widget which handles parameter values for child algorithms
within a model. Instead of the previous approach of requiring
individual widget wrappers to handle creation of a suitable
model widget, we do all this automatically for them.
This widget uses a stacked widget with a toolbutton to select
the parameter's source, instead of the previous combo box approach
(which didn't scale well for large models). I.e. users select
first whether the value is taken from a static value, a
model input, or an output from a different child algorithm. The
widget then changes appearance and behavior based on this
choice.
Additionally, a new option is present for all parameters
of using a "precalculated expression". This expression is
evaluated once before the child algorithm is executed
and used during the execution of that algorithm.
Allows processing models to be stored inside QGIS project files,
so that opening the project makes that model available.
Some models are so intrinsically linked to the logic inside
a particular project that they have no meaning (or are totally
broken) outside of that project (e.g. models which rely
on the presence of particular map layers, relations, etc)
This change allows these models to be stored inside that project,
avoid cluttering up the "global" model provider with models
which make no sense, and making it easier to distribute a single
project with these models included.
Models are stored inside projects by clicking the new "embed
in project" button in the modeler dialog toolbar. Models can be
removed from a project from the model's right click menu in the
toolbox.
This is supported by the toolbox now, so relax the requirement
that all models have a compulsory group name. If no group is set,
the model is shown directly under the Models node in the toolbox.
Also switch a warning from message box to message bar
Because there's some deep underlying issue which causes the dock
layouts to get corrupted in certain circumstances, avoid the
issue entirely by moving construction of the docks out of
the .ui file and instead do it all manually via Python code.
Fixes#16428, #19068
This is used in the algorithm's tooltip in the toolbox, and is intended
for single sentence description of the algorithm, e.g.
"Converts 2D features to 3D by sampling a DEM raster."
Convert grass algorithms to use short description for the
descriptive parts of their names, to cleanup the toolbox
and make it more uniform.
This is a subclass of QgsProcessingParameterNumber, but specifically
for numeric parameters which represent distances. It is linked
to a parent parameter, from which the distance unit will
be determined, and is shown using a dedicated distance widget
within the processing parameters panel. This widget shows
the distance unit.
This avoids the confusion when running algorithms which
use distances where the unit depends on a layer or CRS parameter -
e.g. the distance parameter in the buffer algorithm gives
the distance in layer units... so now we can show those units
directly within the dialog. Hopefully this leads to less
user confusion and accidental "1000 degree buffers"!
Additionally - if the unit is in degrees, a small warning
icon is shown next to the parameter. The tooltip for this
icon advises users to reproject data into a suitable
projected local coordinate system.
Initially implemented for the native buffer and single
sided buffer algorithm only - but more will be added.
Fixes#16290
ModelerParametersDialog and ParametersPanel have to keep list of
wrappers only. widget and label( if needed) are created through
WidgetWrapper.createLabel()