QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
Public Member Functions | Public Attributes | List of all members
QgsLabelPosition Class Reference

#include <qgspallabeling.h>

Public Member Functions

 QgsLabelPosition ()=default
 Constructor for QgsLabelPosition. More...
 
 QgsLabelPosition (QgsFeatureId id, double r, const QVector< QgsPointXY > &corners, const QgsRectangle &rect, double w, double h, const QString &layer, const QString &labeltext, const QFont &labelfont, bool upside_down, bool diagram=false, bool pinned=false, const QString &providerId=QString(), const QgsGeometry &labelGeometry=QgsGeometry(), bool isUnplaced=false)
 Constructor for QgsLabelPosition. More...
 

Public Attributes

QVector< QgsPointXYcornerPoints
 
QgsFeatureId featureId = FID_NULL
 ID of feature associated with this label. More...
 
double height = 0
 Heeght of label bounding box, in map units. More...
 
bool isDiagram = false
 true if label is a diagram. More...
 
bool isPinned = false
 true if label position has been pinned. More...
 
bool isUnplaced = false
 true if label position corresponds to an unplaced label. More...
 
QFont labelFont
 Font which the label is rendered using. More...
 
QgsGeometry labelGeometry
 A polygon geometry representing the label's bounds in map coordinates. More...
 
QgsRectangle labelRect
 
QString labelText
 String shown in label. More...
 
QString layerID
 ID of associated map layer. More...
 
QString providerID
 ID of the associated label provider. More...
 
double rotation = 0
 Rotation of label, in degrees clockwise. More...
 
bool upsideDown = false
 true if label is upside down. More...
 
double width = 0
 Width of label bounding box, in map units. More...
 

Detailed Description

Definition at line 86 of file qgspallabeling.h.

Constructor & Destructor Documentation

◆ QgsLabelPosition() [1/2]

QgsLabelPosition::QgsLabelPosition ( QgsFeatureId  id,
double  r,
const QVector< QgsPointXY > &  corners,
const QgsRectangle rect,
double  w,
double  h,
const QString &  layer,
const QString &  labeltext,
const QFont &  labelfont,
bool  upside_down,
bool  diagram = false,
bool  pinned = false,
const QString &  providerId = QString(),
const QgsGeometry labelGeometry = QgsGeometry(),
bool  isUnplaced = false 
)
inline

Constructor for QgsLabelPosition.

Parameters
idassociated feature ID
rlabel rotation in degrees clockwise
cornerscorner points of label bounding box, in map units
rectlabel bounding box, in map units
wwidth of label, in map units
hheight of label, in map units
layerID of associated map layer
labeltexttext rendered for label
labelfontfont used to render label
upside_downtrue if label is upside down
diagramtrue if label is a diagram
pinnedtrue if label has pinned placement
providerIdID of associated label provider
labelGeometrypolygon geometry of label boundary
isUnplacedset to true if label was unplaced (e.g. due to collisions with other labels)

Definition at line 108 of file qgspallabeling.h.

◆ QgsLabelPosition() [2/2]

QgsLabelPosition::QgsLabelPosition ( )
default

Constructor for QgsLabelPosition.

Member Data Documentation

◆ cornerPoints

QVector< QgsPointXY > QgsLabelPosition::cornerPoints

Definition at line 140 of file qgspallabeling.h.

◆ featureId

QgsFeatureId QgsLabelPosition::featureId = FID_NULL

ID of feature associated with this label.

Definition at line 133 of file qgspallabeling.h.

◆ height

double QgsLabelPosition::height = 0

Heeght of label bounding box, in map units.

Definition at line 157 of file qgspallabeling.h.

◆ isDiagram

bool QgsLabelPosition::isDiagram = false

true if label is a diagram.

Definition at line 182 of file qgspallabeling.h.

◆ isPinned

bool QgsLabelPosition::isPinned = false

true if label position has been pinned.

Definition at line 187 of file qgspallabeling.h.

◆ isUnplaced

bool QgsLabelPosition::isUnplaced = false

true if label position corresponds to an unplaced label.

Since
QGIS 3.10

Definition at line 199 of file qgspallabeling.h.

◆ labelFont

QFont QgsLabelPosition::labelFont

Font which the label is rendered using.

Definition at line 172 of file qgspallabeling.h.

◆ labelGeometry

QgsGeometry QgsLabelPosition::labelGeometry

A polygon geometry representing the label's bounds in map coordinates.

Since
QGIS 3.4.9

Definition at line 147 of file qgspallabeling.h.

◆ labelRect

QgsRectangle QgsLabelPosition::labelRect

Definition at line 141 of file qgspallabeling.h.

◆ labelText

QString QgsLabelPosition::labelText

String shown in label.

Definition at line 167 of file qgspallabeling.h.

◆ layerID

QString QgsLabelPosition::layerID

ID of associated map layer.

Definition at line 162 of file qgspallabeling.h.

◆ providerID

QString QgsLabelPosition::providerID

ID of the associated label provider.

Since
QGIS 2.14

Definition at line 193 of file qgspallabeling.h.

◆ rotation

double QgsLabelPosition::rotation = 0

Rotation of label, in degrees clockwise.

Definition at line 138 of file qgspallabeling.h.

◆ upsideDown

bool QgsLabelPosition::upsideDown = false

true if label is upside down.

Definition at line 177 of file qgspallabeling.h.

◆ width

double QgsLabelPosition::width = 0

Width of label bounding box, in map units.

Definition at line 152 of file qgspallabeling.h.


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