Make sure that results from a feature counter will only be delivered on
the main thread and that they will be discarded if the layer is deleted
meanwhile.
required connections to a QgsLocator
Use this QgsLocatorModel subclass when you want the connections
between a QgsLocator and the model to be automatically created
for you. If more flexibility in model behavior is required,
use the base QgsLocatorModel class instead and setup the
connections manually.
Instead move it to a private QgsGeometry member. It's copied
with QgsGeometry, but not the underlying private geometry
data.
This means the error string can be changed without detaching
(and copying) the geometry data.
Also make greater use of error string for all use of GEOS
functions.
This is the equivalent of std::as_const (which requires c++17) or
qAsConst (which requires Qt 5.7), neither of which we have
as minimum dependancies.
By wrapping implicitly shared Qt containers in qgsAsConst we can
safely use c++ for ranged loops instead of Q_FOREACH. (Since
Q_FOREACH's future is shaky)
See https://www.kdab.com/goodbye-q_foreach/ for further details
on why for causes a detach for Qt containers and why Q_FOREACH
is being removed from Qt.
Now that our minimum VS studio version allowed supports std::round,
we should use that in place of Qt's qRound method.
Because:
- it doesn't truncate to int, resulting in unpredictable
behaviour (refs #16925)
- better to stick to standard c++ methods wherever possible,
since they're likely better supported and optimised by the
compilers
- it's a tiny reduction to the barrier for entry to QGIS
development (I'm sick of pointing out the need to use
qRound during PR reviews!)
And use it when we need to clone parameters (instead of more fragile
conversion to and from variants)
This fixes model loading which use algorithms which create python
subclasses of parameter definitions