This generalizes the logic from QgsLayoutManager, so that additional
manager classes handling other object types can be added without
incurring a lot of near-duplicate code.
This is a step toward allowing storage of elevation profiles
within projects.
This commit adds a virtual method to QgsMapLayer to enable the creation of custom
elevation profiles for any type of layer.
The methods returns a pointer to a helper class of type
QgsAbstractProfileSource which is a factory for profile generators
(cf. documentation for QgsAbstractProfileSource).
Existing layers that derive from QgsAbstractProfileSource just override
this method returning a *this* pointer.
As the method is *sipified* it can be used in python to declare custom
profile source for classes derived from PluginLayer (ownership of the
QgsAbstractProfileSource must then be managed on the python side).
This introduces a new expression and order value in the featurepickermodel and a sortvalue in its feature value gatherer. Sorting is still done in the model (not on feature request), to be not needed to make another request on re-ordering.
This resolves#48191
QgsSipUtils.isPyOwned will return True if an object is owned
by python, or False if ownership is held by another object
or c++ class.
This gives a way to test in advance if we can safely assign
an object to a method which takes ownership (which always results
in a crash).
Deprecate old methods and make methods always take QgsSldExportContext.
Add capacity to QgsSldExportContext to collect export errors and
warnings.
The old API had no way to reliably report errors/warnings during
export to users.
Adds an API which an algorithm can implement to support auto-setting
parameter values. This is designed to handle the case
of eg an algorithm which does a file format translation, where
it's desirable to default the output parameter value to an input
parameter value with a different extension.
This can now be done by implementing autogenerateParameterValues
in the algorithm, eg:
def autogenerateParameterValues(self, existingParameters, changedParameter, mode):
if changedParameter == self.INPUT:
input_file = existingParameters.get(self.INPUT)
if input_file:
input_path = Path(input_file)
if input_path.exists():
# auto set output parameter to same as input but with 'qgs' extension
return {self.OUTPUT: input_path.with_suffix('.qgs').as_posix()}
return {}
Works for both toolbox and batch modes for algorithms
Improves the appearance of labels in situations like road networks,
where things like dual carriageways, service roads, etc can result
in many labels of the exact same text appearing close to each other.
When active, removes any labels with the exact same text (case
sensitive!) which are closer then this minimum distance.
The setting applies across layers, so duplicate text from ANY
layer will be considered.