Class: QgsLabelPosition¶
-
class
qgis.core.
QgsLabelPosition
(id: int, r: float, corners: Iterable[QgsPointXY], rect: QgsRectangle, w: float, h: float, layer: str, labeltext: str, labelfont: QFont, upside_down: bool, diagram: bool = False, pinned: bool = False, providerId: str = '', labelGeometry: QgsGeometry = QgsGeometry(), isUnplaced: bool = False)¶ Bases:
sip.wrapper
Constructor for QgsLabelPosition.
- Parameters
id (int) – associated feature ID
r (float) – label rotation in degrees clockwise
corners (Iterable[QgsPointXY]) – corner points of label bounding box, in map units
rect (QgsRectangle) – label bounding box, in map units
w (float) – width of label, in map units
h (float) – height of label, in map units
layer (str) – ID of associated map layer
labeltext (str) – text rendered for label
labelfont (QFont) – font used to render label
upside_down (bool) –
True
if label is upside downdiagram (bool = False) –
True
if label is a diagrampinned (bool = False) –
True
if label has pinned placementproviderId (str = '') – ID of associated label provider
labelGeometry (
QgsGeometry
= QgsGeometry()) – polygon geometry of label boundaryisUnplaced (bool = False) – set to
True
if label was unplaced (e.g. due to collisions with other labels)
QgsLabelPosition() Constructor for QgsLabelPosition
QgsLabelPosition(
QgsLabelPosition
)Attributes
-
cornerPoints
¶
-
featureId
¶
-
height
¶
-
isDiagram
¶
-
isPinned
¶
-
isUnplaced
¶
-
labelFont
¶
-
labelGeometry
¶
-
labelRect
¶
-
labelText
¶
-
layerID
¶
-
providerID
¶
-
rotation
¶
-
upsideDown
¶
-
width
¶