in model child algorithms
Prior to this change if you edited an algorithm in a model and
tried to enter a preset string for certain parameter types, this
string would get silently discarded on closing the dialog. E.g.
with a dissolve algorithm it was not possible to have a fixed
field name within the model to dissolve by.
This was caused by WidgetWrapper.comboValue returning the customData
for these manually entered values in the parameters combo box,
yet manually entered values never have custom data.
To work around this we only return the custom data if its
set for the selected item - otherwise we return the text unchanged.
In order to handle the "[not set]" options, a new static custom
data value of WidgetWrapper.NOT_SET_OPTION is added to that
comboValue can detect this and return the appropriate None value.
always add a consistent amount of attributes regardless of the
code paths taken
Some algorithms were adding features to data providers with
different number of attributes vs the layer's fields - this is
not supported and depending on the data provider will have
different (bad) results.
be prepared
There's cases where this happens without reflecting an invalid
expression. So we can try to prepare, but not abort if the
preparation fails.
Fixes#18103
- Fix missing format call for string when calculated number
of points is 0
- Fix incorrect progress reports which were spamming the dialog
and causing UI hangs, and slow algorithm execution
if they are unique in the current project
Instead of always using the layer id, which is generally
gibberish and meaningless for users, instead prefer to use
the layer name as an input in the batch processing dialog. This
is done only if the name is unique within the current project's
loaded layers.
This change makes the dialog more user-friendly, but more importantly
it means that autofilling output values based on an input layer
parameter generates more meaningful automatic output file names.
metadata editor to make their operation more self-explanatory
for users.
Also add tooltips to the buttons describing their function, and
allow the buttons to operate on multiple selected rows at once.
Fixes#18090
This is used a lot, yet the current constructor calls the
normalize() method which does a bunch of operations for no
result.
So instead provide a simple optimised null QgsRectangle
constructor and save a lot of cycles.
Refs #17809
This was a missing capability in the processing API - while algorithms
could declare multiple layer input parameters, there was no corresponding
multi-layer output. This meant that algorithms (such as Package Layers,
Vector Split) which create a set of layers which cannot be determined
in advance had no way to pass these generated layers on for further model
processing steps.
It's also useful for algorithms which operate on a specified folder,
processing all layers found there, and allowing these generated
outputs to be utilised in other model steps (e.g. packaging
all of them, merging them, etc)
Since libspatialindex is not thread safe on all platforms, and
have expressed desire to remove the thread safety that they DO
have on remaining platforms, it's safer and easier for us
to manually add locks to QgsSpatialIndex and be gauranteed that
this class is thread safe on all platforms and libspatialindex
versions.
Also improve docs for the class.
Since the underlying libspatialindex is not thread safe
on some platforms (e.g. Windows), manual calls to detach()
must be made if a QgsSpatialIndex is to be accessed across
multiple threads.
Note that for platforms on which libspatialindex is thread
safe, calling detach() has no effect and does not force the
deep copy.
their unique id()
This is used when generating the QgsHelp url for algorithms
attached to the providers.
Implement helpId overrides for the native and 3d providers so
that they return 'qgis' helpIds, meaning that all QGIS processing
algorithm documentation can be kept within the same url path
regardless of which QGIS provider library it sits within.
This also allows us to freely move algorithms from the Python
'qgis' provider to c++ 'native' provider in future releases
without breaking the help URLs.
Fixes#17231