Class: QgsLabelPointSettings

class qgis.core.QgsLabelPointSettings

Bases: sip.wrapper

Contains settings related to how the label engine places and formats labels for point features, or polygon features which are labeled in the “around” or “over” centroid placement modes.

Added in version 3.38:

Methods

maximumDistance

Returns the maximum distance which labels are allowed to be from their corresponding points.

maximumDistanceMapUnitScale

Returns the map unit scale for label maximum distance.

maximumDistanceUnit

Returns the units for label maximum distance.

predefinedPositionOrder

Returns the ordered list of predefined label positions for points.

quadrant

Returns the quadrant in which to offset labels from the point.

setMaximumDistance

Sets the maximum distance which labels are allowed to be from their corresponding points.

setMaximumDistanceMapUnitScale

Sets the map unit scale for label maximum distance.

setMaximumDistanceUnit

Sets the unit for label maximum distance.

setPredefinedPositionOrder

Sets the ordered list of predefined label positions for points.

setQuadrant

Sets the quadrant in which to offset labels from the point.

updateDataDefinedProperties

Updates the point settings to respect any data defined properties set within the specified properties collection.

Signals

staticMetaObject

Attributes

staticMetaObject

maximumDistance(self) float

Returns the maximum distance which labels are allowed to be from their corresponding points.

This setting works alongside the standard label offset distance properties to define a permissible range of distances at which labels can be placed from their points.

The default value is 0, which indicates that no maximum is set and the label’s usual distance from point will always be respected.

Return type:

float

maximumDistanceMapUnitScale(self) QgsMapUnitScale

Returns the map unit scale for label maximum distance.

Return type:

QgsMapUnitScale

maximumDistanceUnit(self) Qgis.RenderUnit

Returns the units for label maximum distance.

Return type:

Qgis.RenderUnit

predefinedPositionOrder(self) List[Qgis.LabelPredefinedPointPosition]

Returns the ordered list of predefined label positions for points.

Positions earlier in the list will be prioritized over later positions. Only used when the placement is set to Qgis.LabelPlacement.OrderedPositionsAroundPoint.

Return type:

List[Qgis.LabelPredefinedPointPosition]

quadrant(self) Qgis.LabelQuadrantPosition

Returns the quadrant in which to offset labels from the point.

See also

setQuadrant()

Return type:

Qgis.LabelQuadrantPosition

setMaximumDistance(self, distance: float)

Sets the maximum distance which labels are allowed to be from their corresponding points.

This setting works alongside the standard label offset distance properties to define a permissible range of distances at which labels can be placed from their points.

Setting distance to 0 indicates that no maximum is set and the label’s usual distance from point will always be respected.

Parameters:

distance (float)

setMaximumDistanceMapUnitScale(self, scale: QgsMapUnitScale)

Sets the map unit scale for label maximum distance.

Parameters:

scale (QgsMapUnitScale)

setMaximumDistanceUnit(self, unit: Qgis.RenderUnit)

Sets the unit for label maximum distance.

Parameters:

unit (Qgis.RenderUnit)

setPredefinedPositionOrder(self, order: Iterable[Qgis.LabelPredefinedPointPosition])

Sets the ordered list of predefined label positions for points.

Positions earlier in the list will be prioritized over later positions. Only used when the placement is set to Qgis.LabelPlacement.OrderedPositionsAroundPoint.

Parameters:

order (Iterable[Qgis.LabelPredefinedPointPosition])

setQuadrant(self, quadrant: Qgis.LabelQuadrantPosition)

Sets the quadrant in which to offset labels from the point.

See also

quadrant()

Parameters:

quadrant (Qgis.LabelQuadrantPosition)

staticMetaObject = <PyQt5.QtCore.QMetaObject object>
updateDataDefinedProperties(self, properties: QgsPropertyCollection, context: QgsExpressionContext)

Updates the point settings to respect any data defined properties set within the specified properties collection.

Parameters: