Class: QgsLabelSearchTree

Queries the labeling structure at a given point.

This class is a small wrapper around the pal RTree class.

Methods

allLabels

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

calloutsInRectangle

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

clear

Removes and deletes all the entries.

setMapSettings

Sets the map settings associated with the labeling run.

class qgis.core.QgsLabelSearchTree[source]

Bases: object

allLabels(self) List[QgsLabelPosition]

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

Added in version 3.20.

Return type:

List[QgsLabelPosition]

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

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

The rectangle is specified in map coordinates.

QgsLabelSearchTree keeps ownership, don’t delete the returned objects.

Added in version 3.20.

Parameters:

rectangle (QgsRectangle)

Return type:

List[QgsCalloutPosition]

clear(self)[source]

Removes and deletes all the entries.

Deprecated since version 3.40: Has no effect since QGIS 3.12.

setMapSettings(self, settings: QgsMapSettings)[source]

Sets the map settings associated with the labeling run.

Added in version 3.4.8.

Parameters:

settings (QgsMapSettings)