Class: QgsLabelSearchTree

class qgis.core.QgsLabelSearchTree

Bases: sip.wrapper

A class to query the labeling structure at a given point (small wrapper around pal RTree class)

QgsLabelSearchTree() Constructor for QgsLabelSearchTree.

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.

allLabels(self) List[QgsLabelPosition]

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

New 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.

New in version 3.20.

Parameters:

rectangle (QgsRectangle) –

Return type:

List[QgsCalloutPosition]

clear(self)

Removes and deletes all the entries.

Deprecated since version has: no effect since QGIS 3.12

setMapSettings(self, settings: QgsMapSettings)

Sets the map settings associated with the labeling run.

New in version 3.4.8.

Parameters:

settings (QgsMapSettings) –