Class: QgsLabelPlacementSettings¶
- class qgis.core.QgsLabelPlacementSettings¶
Bases:
sip.wrapper
Contains general settings related to how labels are placed.
New in version 3.26:
Methods
Returns
True
if labels can be placed in inferior fallback positions if they cannot otherwise be placed.Returns the technique used to handle overlapping labels.
Sets whether labels can be placed in inferior fallback positions if they cannot otherwise be placed.
Sets the technique used to handle overlapping labels.
Updates the placement settings to respect any data defined properties set within the specified
properties
collection.- allowDegradedPlacement(self) bool ¶
Returns
True
if labels can be placed in inferior fallback positions if they cannot otherwise be placed.For instance, this will permit a curved line label to fallback to a horizontal label at the end of the line if the label cannot otherwise be placed on the line in a curved manner.
See also
- Return type
bool
- overlapHandling(self) Qgis.LabelOverlapHandling ¶
Returns the technique used to handle overlapping labels.
See also
- Return type
- setAllowDegradedPlacement(self, allow: bool)¶
Sets whether labels can be placed in inferior fallback positions if they cannot otherwise be placed.
For instance, this will permit a curved line label to fallback to a horizontal label at the end of the line if the label cannot otherwise be placed on the line in a curved manner.
See also
- Parameters
allow (bool) –
- setOverlapHandling(self, handling: Qgis.LabelOverlapHandling)¶
Sets the technique used to handle overlapping labels.
See also
- Parameters
handling (Qgis.LabelOverlapHandling) –
- updateDataDefinedProperties(self, properties: QgsPropertyCollection, context: QgsExpressionContext)¶
Updates the placement settings to respect any data defined properties set within the specified
properties
collection.- Parameters
properties (QgsPropertyCollection) –
context (QgsExpressionContext) –