Class: QgsLabelingResults

class qgis.core.QgsLabelingResults

Bases: sip.wrapper

Class that stores computed placement from labeling engine.

New in version 2.4:

Methods

allLabels

Returns a list of all labels generated by the labeling run.

calloutsWithinRectangle

Returns a list of callouts with origins or destinations inside the given rectangle.

labelsAtPosition

Returns the details of any labels placed at the specified point (in map coordinates).

labelsWithinRect

Returns the details of any labels placed within the specified rectangle (in map coordinates).

setMapSettings

Sets the map settings associated with the labeling run.

allLabels(self) List[QgsLabelPosition]

Returns a list of all labels generated by the labeling run.

New in version 3.20.

Return type

List[QgsLabelPosition]

calloutsWithinRectangle(self, rectangle: QgsRectangle) List[QgsCalloutPosition]

Returns a list of callouts with origins or destinations inside the given rectangle.

The rectangle is specified in map coordinates.

New in version 3.20.

Parameters

rectangle (QgsRectangle) –

Return type

List[QgsCalloutPosition]

labelsAtPosition(self, p: QgsPointXY) List[QgsLabelPosition]

Returns the details of any labels placed at the specified point (in map coordinates).

Parameters

p (QgsPointXY) –

Return type

List[QgsLabelPosition]

labelsWithinRect(self, r: QgsRectangle) List[QgsLabelPosition]

Returns the details of any labels placed within the specified rectangle (in map coordinates).

Parameters

r (QgsRectangle) –

Return type

List[QgsLabelPosition]

setMapSettings(self, settings: QgsMapSettings)

Sets the map settings associated with the labeling run.

New in version 3.4.8.

Parameters

settings (QgsMapSettings) –