Class: QgsLabelPlacementSettings¶
Contains general settings related to how labels are placed.
Added in version 3.26.
Methods
Returns   | 
|
Returns the technique used to handle overlapping labels.  | 
|
Returns the label prioritization technique.  | 
|
Sets whether labels can be placed in inferior fallback positions if they cannot otherwise be placed.  | 
|
Sets the technique used to handle overlapping labels.  | 
|
Sets the technique used to prioritize labels.  | 
|
Updates the placement settings to respect any data defined properties set within the specified properties collection.  | 
- class qgis.core.QgsLabelPlacementSettings[source]¶
 Bases:
object- allowDegradedPlacement(self) bool[source]¶
 Returns
Trueif 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[source]¶
 Returns the technique used to handle overlapping labels.
See also
- Return type:
 
- prioritization(self) Qgis.LabelPrioritization[source]¶
 Returns the label prioritization technique.
See also
Added in version 3.38.
- Return type:
 
- setAllowDegradedPlacement(self, allow: bool)[source]¶
 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)[source]¶
 Sets the technique used to handle overlapping labels.
See also
- Parameters:
 handling (Qgis.LabelOverlapHandling)
- setPrioritization(self, prioritization: Qgis.LabelPrioritization)[source]¶
 Sets the technique used to prioritize labels.
See also
Added in version 3.38.
- Parameters:
 prioritization (Qgis.LabelPrioritization)
- updateDataDefinedProperties(self, properties: QgsPropertyCollection, context: QgsExpressionContext)[source]¶
 Updates the placement settings to respect any data defined properties set within the specified
propertiescollection.- Parameters:
 properties (QgsPropertyCollection)
context (QgsExpressionContext)