Subgroup: Pal

Class: QgsPalLayerSettings

class qgis.core.QgsPalLayerSettings

Bases: sip.wrapper

QgsPalLayerSettings(s: QgsPalLayerSettings)

Methods

calculateLabelSize
dataDefinedProperties Returns a reference to the label’s property collection, used for data defined overrides.
format Returns the label text formatting settings, e.g., font settings, buffer settings, etc.
getLabelExpression Returns the QgsExpression for this label settings.
propertyDefinitions Returns the labeling property definitions.
readXml Read settings from a DOM element
registerFeature Register a feature for labeling.
setDataDefinedProperties Sets the label’s property collection, used for data defined overrides.
setFormat Sets the label text formatting settings, e.g., font settings, buffer settings, etc.
writeXml Write settings into a DOM element

Signals

Attributes

AboveLine
AlwaysShow
AroundPoint
AutoWrapLength
BelowLine
Bold
BottomLeft
BottomMiddle
BottomRight
BottomSlightlyLeft
BottomSlightlyRight
BufferBlendMode
BufferColor
BufferDraw
BufferJoinStyle
BufferOpacity
BufferSize
BufferTransp
BufferUnit
CentroidWhole
Color
Curved
CurvedCharAngleInOut
DirSymbDraw
DirSymbLeft
DirSymbPlacement
DirSymbReverse
DirSymbRight
DistanceUnits
Family
FontBlendMode
FontCase
FontLetterSpacing
FontLimitPixel
FontMaxPixel
FontMinPixel
FontOpacity
FontSizeUnit
FontStyle
FontTransp
FontWordSpacing
Free
FromPoint
FromSymbolBounds
Hali
Horizontal
IsObstacle
Italic
LabelDistance
LabelRotation
Line
MapOrientation
MaxScale
MaximumScale
MiddleLeft
MiddleRight
MinScale
MinimumScale
MultiCenter
MultiFollowPlacement
MultiLeft
MultiLineAlignment
MultiLineHeight
MultiLineWrapChar
MultiRight
NumDecimals
NumFormat
NumPlusSign
ObstacleFactor
OffsetQuad
OffsetRotation
OffsetUnits
OffsetXY
OnLine
OrderedPositionsAroundPoint
OverPoint
PerimeterCurved
PolygonBoundary
PolygonInterior
PolygonWhole
PositionX
PositionY
PredefinedPositionOrder
Priority
QuadrantAbove
QuadrantAboveLeft
QuadrantAboveRight
QuadrantBelow
QuadrantBelowLeft
QuadrantBelowRight
QuadrantLeft
QuadrantOver
QuadrantRight
RepeatDistance
RepeatDistanceUnit
Rotation
ScaleVisibility
ShadowBlendMode
ShadowColor
ShadowDraw
ShadowOffsetAngle
ShadowOffsetDist
ShadowOffsetUnits
ShadowOpacity
ShadowRadius
ShadowRadiusUnits
ShadowScale
ShadowTransparency
ShadowUnder
ShapeBlendMode
ShapeDraw
ShapeFillColor
ShapeJoinStyle
ShapeKind
ShapeOffset
ShapeOffsetUnits
ShapeOpacity
ShapeRadii
ShapeRadiiUnits
ShapeRotation
ShapeRotationType
ShapeSVGFile
ShapeSizeType
ShapeSizeUnits
ShapeSizeX
ShapeSizeY
ShapeStrokeColor
ShapeStrokeWidth
ShapeStrokeWidthUnits
ShapeTransparency
Show
ShowAll
ShowDefined
Size
Strikeout
SymbolAbove
SymbolBelow
SymbolLeftRight
TopLeft
TopMiddle
TopRight
TopSlightlyLeft
TopSlightlyRight
Underline
Upright
Vali
ZIndex
qgis.core.QgsPalLayerSettings.addDirectionSymbol
qgis.core.QgsPalLayerSettings.angleOffset
qgis.core.QgsPalLayerSettings.autoWrapLength
qgis.core.QgsPalLayerSettings.centroidInside
qgis.core.QgsPalLayerSettings.centroidWhole
qgis.core.QgsPalLayerSettings.ct
qgis.core.QgsPalLayerSettings.decimals
qgis.core.QgsPalLayerSettings.displayAll
qgis.core.QgsPalLayerSettings.dist
qgis.core.QgsPalLayerSettings.distMapUnitScale
qgis.core.QgsPalLayerSettings.distUnits
qgis.core.QgsPalLayerSettings.drawLabels
qgis.core.QgsPalLayerSettings.extentGeom
qgis.core.QgsPalLayerSettings.fieldIndex
qgis.core.QgsPalLayerSettings.fieldName
qgis.core.QgsPalLayerSettings.fitInPolygonOnly
qgis.core.QgsPalLayerSettings.fontLimitPixelSize
qgis.core.QgsPalLayerSettings.fontMaxPixelSize
qgis.core.QgsPalLayerSettings.fontMinPixelSize
qgis.core.QgsPalLayerSettings.formatNumbers
qgis.core.QgsPalLayerSettings.isExpression
qgis.core.QgsPalLayerSettings.labelOffsetMapUnitScale
qgis.core.QgsPalLayerSettings.labelPerPart
qgis.core.QgsPalLayerSettings.leftDirectionSymbol
qgis.core.QgsPalLayerSettings.limitNumLabels
qgis.core.QgsPalLayerSettings.mCurFeat
qgis.core.QgsPalLayerSettings.mCurFields
qgis.core.QgsPalLayerSettings.mFeatsRegPal
qgis.core.QgsPalLayerSettings.mFeatsSendingToPal
qgis.core.QgsPalLayerSettings.mFeaturesToLabel
qgis.core.QgsPalLayerSettings.maxCurvedCharAngleIn
qgis.core.QgsPalLayerSettings.maxCurvedCharAngleOut
qgis.core.QgsPalLayerSettings.maxNumLabels
qgis.core.QgsPalLayerSettings.maximumScale
qgis.core.QgsPalLayerSettings.mergeLines
qgis.core.QgsPalLayerSettings.minFeatureSize
qgis.core.QgsPalLayerSettings.minimumScale
qgis.core.QgsPalLayerSettings.multilineAlign
qgis.core.QgsPalLayerSettings.obstacle
qgis.core.QgsPalLayerSettings.obstacleFactor
qgis.core.QgsPalLayerSettings.obstacleType
qgis.core.QgsPalLayerSettings.offsetType
qgis.core.QgsPalLayerSettings.offsetUnits
qgis.core.QgsPalLayerSettings.placeDirectionSymbol
qgis.core.QgsPalLayerSettings.placement
qgis.core.QgsPalLayerSettings.placementFlags
qgis.core.QgsPalLayerSettings.plusSign
qgis.core.QgsPalLayerSettings.preserveRotation
qgis.core.QgsPalLayerSettings.previewBkgrdColor
qgis.core.QgsPalLayerSettings.priority
qgis.core.QgsPalLayerSettings.ptOne
qgis.core.QgsPalLayerSettings.ptZero
qgis.core.QgsPalLayerSettings.quadOffset
qgis.core.QgsPalLayerSettings.repeatDistance
qgis.core.QgsPalLayerSettings.repeatDistanceMapUnitScale
qgis.core.QgsPalLayerSettings.repeatDistanceUnit
qgis.core.QgsPalLayerSettings.reverseDirectionSymbol
qgis.core.QgsPalLayerSettings.rightDirectionSymbol
qgis.core.QgsPalLayerSettings.scaleVisibility
qgis.core.QgsPalLayerSettings.substitutions
qgis.core.QgsPalLayerSettings.upsidedownLabels
qgis.core.QgsPalLayerSettings.useMaxLineLengthForAutoWrap
qgis.core.QgsPalLayerSettings.useSubstitutions
qgis.core.QgsPalLayerSettings.wrapChar
qgis.core.QgsPalLayerSettings.xOffset
qgis.core.QgsPalLayerSettings.xform
qgis.core.QgsPalLayerSettings.yOffset
qgis.core.QgsPalLayerSettings.zIndex
AboveLine = 2
AlwaysShow = 20
AroundPoint = 0
AutoWrapLength = 101
BelowLine = 4
Bold = 1
BottomLeft = 7
BottomMiddle = 9
BottomRight = 11
BottomSlightlyLeft = 8
BottomSlightlyRight = 10
BufferBlendMode = 45
BufferColor = 8
BufferDraw = 42
BufferJoinStyle = 44
BufferOpacity = 94
BufferSize = 7
BufferTransp = 19
BufferUnit = 43
CentroidWhole = 76
Color = 4
Curved = 3
CurvedCharAngleInOut = 83
DirSymbDraw = 34
DirSymbLeft = 35
DirSymbPlacement = 37
DirSymbReverse = 38
DirSymbRight = 36
class DirectionSymbols

Bases: int

DistanceUnits = 81
Family = 6
FontBlendMode = 30
FontCase = 27
FontLetterSpacing = 28
FontLimitPixel = 24
FontMaxPixel = 26
FontMinPixel = 25
FontOpacity = 92
FontSizeUnit = 22
FontStyle = 21
FontTransp = 18
FontWordSpacing = 29
Free = 5
FromPoint = 0
FromSymbolBounds = 1
Hali = 11
Horizontal = 4
IsObstacle = 88
Italic = 2
LabelDistance = 13
LabelRotation = 96
Line = 2
class LinePlacementFlags

Bases: int

MapOrientation = 8
MaxScale = 17
MaximumScale = 98
MiddleLeft = 5
MiddleRight = 6
MinScale = 16
MinimumScale = 97
MultiCenter = 1
MultiFollowPlacement = 3
MultiLeft = 0
class MultiLineAlign

Bases: int

MultiLineAlignment = 33
MultiLineHeight = 32
MultiLineWrapChar = 31
MultiRight = 2
NumDecimals = 40
NumFormat = 39
NumPlusSign = 41
ObstacleFactor = 89
class ObstacleType

Bases: int

OffsetQuad = 77
OffsetRotation = 82
class OffsetType

Bases: int

OffsetUnits = 80
OffsetXY = 78
OnLine = 1
OrderedPositionsAroundPoint = 6
OverPoint = 1
PerimeterCurved = 7
class Placement

Bases: int

PolygonBoundary = 1
PolygonInterior = 0
PolygonWhole = 2
PositionX = 9
PositionY = 10
class PredefinedPointPosition

Bases: int

PredefinedPositionOrder = 91
Priority = 87
class Property

Bases: int

QuadrantAbove = 1
QuadrantAboveLeft = 0
QuadrantAboveRight = 2
QuadrantBelow = 7
QuadrantBelowLeft = 6
QuadrantBelowRight = 8
QuadrantLeft = 3
QuadrantOver = 4
class QuadrantPosition

Bases: int

QuadrantRight = 5
RepeatDistance = 84
RepeatDistanceUnit = 86
Rotation = 14
ScaleVisibility = 23
ShadowBlendMode = 75
ShadowColor = 74
ShadowDraw = 65
ShadowOffsetAngle = 67
ShadowOffsetDist = 68
ShadowOffsetUnits = 69
ShadowOpacity = 95
ShadowRadius = 70
ShadowRadiusUnits = 71
ShadowScale = 73
ShadowTransparency = 72
ShadowUnder = 66
ShapeBlendMode = 64
ShapeDraw = 46
ShapeFillColor = 58
ShapeJoinStyle = 62
ShapeKind = 47
ShapeOffset = 54
ShapeOffsetUnits = 55
ShapeOpacity = 93
ShapeRadii = 56
ShapeRadiiUnits = 57
ShapeRotation = 53
ShapeRotationType = 52
ShapeSVGFile = 48
ShapeSizeType = 49
ShapeSizeUnits = 51
ShapeSizeX = 50
ShapeSizeY = 85
ShapeStrokeColor = 59
ShapeStrokeWidth = 60
ShapeStrokeWidthUnits = 61
ShapeTransparency = 63
Show = 15
ShowAll = 2
ShowDefined = 1
Size = 0
Strikeout = 5
SymbolAbove = 1
SymbolBelow = 2
SymbolLeftRight = 0
TopLeft = 0
TopMiddle = 2
TopRight = 4
TopSlightlyLeft = 1
TopSlightlyRight = 3
Underline = 3
Upright = 0
class UpsideDownLabels

Bases: int

Vali = 12
ZIndex = 90
addDirectionSymbol
angleOffset
autoWrapLength
calculateLabelSize(self, fm: QFontMetricsF, text: str, f: QgsFeature = None, context: QgsRenderContext = None) → Tuple[float, float]
centroidInside
centroidWhole
ct
dataDefinedProperties(self) → QgsPropertyCollection

Returns a reference to the label’s property collection, used for data defined overrides.

New in version 3.0.

decimals
displayAll
dist
distMapUnitScale
distUnits
drawLabels
extentGeom
fieldIndex
fieldName
fitInPolygonOnly
fontLimitPixelSize
fontMaxPixelSize
fontMinPixelSize
format(self) → QgsTextFormat

Returns the label text formatting settings, e.g., font settings, buffer settings, etc.

See also

setFormat()

New in version 3.0.

formatNumbers
getLabelExpression(self) → QgsExpression

Returns the QgsExpression for this label settings. May be None if isExpression is false.

isExpression
labelOffsetMapUnitScale
labelPerPart
leftDirectionSymbol
limitNumLabels
mCurFeat
mCurFields
mFeatsRegPal
mFeatsSendingToPal
mFeaturesToLabel
maxCurvedCharAngleIn
maxCurvedCharAngleOut
maxNumLabels
maximumScale
mergeLines
minFeatureSize
minimumScale
multilineAlign
obstacle
obstacleFactor
obstacleType
offsetType
offsetUnits
placeDirectionSymbol
placement
placementFlags
plusSign
preserveRotation
previewBkgrdColor
priority
propertyDefinitions() → object

Returns the labeling property definitions.

New in version 3.0.

ptOne
ptZero
quadOffset
readXml(self, elem: QDomElement, context: QgsReadWriteContext)

Read settings from a DOM element

New in version 2.12.

registerFeature(self, f: QgsFeature, context: QgsRenderContext)

Register a feature for labeling.

Parameters:
  • f – feature to label
  • context – render context. The QgsExpressionContext contained within the render context must have already had the feature and fields sets prior to calling this method.
  • labelFeature – if using QgsLabelingEngine, this will receive the label feature. Not available in Python bindings.
  • obstacleGeometry – optional obstacle geometry, if a different geometry to the feature’s geometry should be used as an obstacle for labels (e.g., if the feature has been rendered with an offset point symbol, the obstacle geometry should represent the bounds of the offset symbol). If not set, the feature’s original geometry will be used as an obstacle for labels. Not available in Python bindings.
repeatDistance
repeatDistanceMapUnitScale
repeatDistanceUnit
reverseDirectionSymbol
rightDirectionSymbol
scaleVisibility
setDataDefinedProperties(self, collection: QgsPropertyCollection)

Sets the label’s property collection, used for data defined overrides.

Parameters:collection – property collection. Existing properties will be replaced.

New in version 3.0.

setFormat(self, format: QgsTextFormat)

Sets the label text formatting settings, e.g., font settings, buffer settings, etc.

Parameters:format – label text format

See also

format()

New in version 3.0.

substitutions
upsidedownLabels
useMaxLineLengthForAutoWrap
useSubstitutions
wrapChar
writeXml(self, doc: QDomDocument, context: QgsReadWriteContext) → QDomElement

Write settings into a DOM element

New in version 2.12.

xOffset
xform
yOffset
zIndex