QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
Public Member Functions | List of all members
QgsLabelSearchTree Class Reference

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

#include <qgslabelsearchtree.h>

Public Member Functions

 QgsLabelSearchTree ()=default
 Constructor for QgsLabelSearchTree. More...
 
 QgsLabelSearchTree (const QgsLabelSearchTree &rh)=delete
 QgsLabelSearchTree cannot be copied. More...
 
 ~QgsLabelSearchTree ()
 
void clear ()
 Removes and deletes all the entries. More...
 
bool insertLabel (pal::LabelPosition *labelPos, QgsFeatureId featureId, const QString &layerName, const QString &labeltext, const QFont &labelfont, bool diagram=false, bool pinned=false, const QString &providerId=QString(), bool isUnplaced=false)
 Inserts label position. More...
 
void label (const QgsPointXY &p, QList< QgsLabelPosition *> &posList) const
 Returns label position(s) at a given point. More...
 
void labelsInRect (const QgsRectangle &r, QList< QgsLabelPosition *> &posList) const
 Returns label position(s) in given rectangle. More...
 
QgsLabelSearchTreeoperator= (const QgsLabelSearchTree &rh)=delete
 QgsLabelSearchTree cannot be copied. More...
 
void setMapSettings (const QgsMapSettings &settings)
 Sets the map settings associated with the labeling run. More...
 

Detailed Description

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

Definition at line 45 of file qgslabelsearchtree.h.

Constructor & Destructor Documentation

◆ QgsLabelSearchTree() [1/2]

QgsLabelSearchTree::QgsLabelSearchTree ( )
default

Constructor for QgsLabelSearchTree.

◆ ~QgsLabelSearchTree()

QgsLabelSearchTree::~QgsLabelSearchTree ( )

Definition at line 25 of file qgslabelsearchtree.cpp.

◆ QgsLabelSearchTree() [2/2]

QgsLabelSearchTree::QgsLabelSearchTree ( const QgsLabelSearchTree rh)
delete

QgsLabelSearchTree cannot be copied.

Member Function Documentation

◆ clear()

void QgsLabelSearchTree::clear ( )

Removes and deletes all the entries.

Definition at line 139 of file qgslabelsearchtree.cpp.

◆ insertLabel()

bool QgsLabelSearchTree::insertLabel ( pal::LabelPosition labelPos,
QgsFeatureId  featureId,
const QString &  layerName,
const QString &  labeltext,
const QFont &  labelfont,
bool  diagram = false,
bool  pinned = false,
const QString &  providerId = QString(),
bool  isUnplaced = false 
)

Inserts label position.

Does not take ownership of labelPos

Returns
true in case of success
Note
not available in Python bindings

Definition at line 78 of file qgslabelsearchtree.cpp.

◆ label()

void QgsLabelSearchTree::label ( const QgsPointXY p,
QList< QgsLabelPosition *> &  posList 
) const

Returns label position(s) at a given point.

QgsLabelSearchTree keeps ownership, don't delete the LabelPositions

Note
not available in Python bindings TODO: why does this break bindings with QList<QgsLabelPosition>?

Definition at line 30 of file qgslabelsearchtree.cpp.

◆ labelsInRect()

void QgsLabelSearchTree::labelsInRect ( const QgsRectangle r,
QList< QgsLabelPosition *> &  posList 
) const

Returns label position(s) in given rectangle.

QgsLabelSearchTree keeps ownership, don't delete the LabelPositions

Note
not available in Python bindings TODO: why does this break bindings with QList<QgsLabelPosition>?

Definition at line 55 of file qgslabelsearchtree.cpp.

◆ operator=()

QgsLabelSearchTree& QgsLabelSearchTree::operator= ( const QgsLabelSearchTree rh)
delete

QgsLabelSearchTree cannot be copied.

◆ setMapSettings()

void QgsLabelSearchTree::setMapSettings ( const QgsMapSettings settings)

Sets the map settings associated with the labeling run.

Since
QGIS 3.4.8

Definition at line 121 of file qgslabelsearchtree.cpp.


The documentation for this class was generated from the following files: