Class: QgsArrowSymbolLayer

class qgis.core.QgsArrowSymbolLayer

Bases: QgsLineSymbolLayer

Line symbol layer used for representing lines as arrows.

QgsArrowSymbolLayer() Simple constructor

Methods

arrowStartWidth

Gets current arrow start width.

arrowStartWidthUnit

Gets the unit for the arrow start width

arrowStartWidthUnitScale

Gets the scale for the arrow start width

arrowType

Gets the current arrow type

arrowWidth

Gets current arrow width

arrowWidthUnit

Gets the unit for the arrow width

arrowWidthUnitScale

Gets the scale for the arrow width

canCauseArtifactsBetweenAdjacentTiles

rtype:

bool

clone

rtype:

Optional[QgsArrowSymbolLayer]

color

rtype:

QColor

copyDataDefinedProperties

Copies all data defined properties of this layer to another symbol layer.

copyPaintEffect

Copies paint effect of this layer to another symbol layer

create

Create a new QgsArrowSymbolLayer

hasDataDefinedProperties

rtype:

bool

headLength

Gets the current arrow head length

headLengthUnit

Gets the unit for the head length

headLengthUnitScale

Gets the scale for the head length

headThickness

Gets the current arrow head height

headThicknessUnit

Gets the unit for the head height

headThicknessUnitScale

Gets the scale for the head height

headType

Gets the current head type

installMasks

When rendering, install masks on context painter if recursive is True masks are installed recursively for all children symbol layers

isCurved

Returns whether it is a curved arrow or a straight one

isRepeated

Returns whether the arrow is repeated along the line or not

layerType

rtype:

str

properties

rtype:

Dict[str, Any]

removeMasks

When rendering, remove previously installed masks from context painter if recursive is True masks are removed recursively for all children symbol layers

renderPolyline

param points:

restoreOldDataDefinedProperties

Restores older data defined properties from string map.

setArrowStartWidth

Sets the arrow start width

setArrowStartWidthUnit

Sets the unit for the arrow start width

setArrowStartWidthUnitScale

Sets the scale for the arrow start width

setArrowType

Sets the arrow type

setArrowWidth

Sets the arrow width

setArrowWidthUnit

Sets the unit for the arrow width

setArrowWidthUnitScale

Sets the scale for the arrow width

setColor

param c:

setHeadLength

Sets the arrow head length

setHeadLengthUnit

Sets the unit for the head length

setHeadLengthUnitScale

Sets the scale for the head length

setHeadThickness

Sets the arrow head height

setHeadThicknessUnit

Sets the unit for the head height

setHeadThicknessUnitScale

Sets the scale for the head height

setHeadType

Sets the head type

setIsCurved

Sets whether it is a curved arrow or a straight one

setIsRepeated

Sets whether the arrow is repeated along the line

setOutputUnit

param unit:

setSubSymbol

param symbol:

shouldRenderUsingSelectionColor

Returns True if the symbol layer should be rendered using the selection color from the render context.

startRender

param context:

stopRender

param context:

subSymbol

rtype:

Optional[QgsSymbol]

usedAttributes

param context:

usesMapUnits

rtype:

bool

Attributes

ArrowLeftHalf

ArrowPlain

ArrowRightHalf

HeadDouble

HeadReversed

HeadSingle

ArrowLeftHalf = 1
ArrowPlain = 0
ArrowRightHalf = 2
class ArrowType

Bases: int

HeadDouble = 2
HeadReversed = 1
HeadSingle = 0
class HeadType

Bases: int

arrowStartWidth(self) float

Gets current arrow start width. Only meaningful for single headed arrows

Return type:

float

arrowStartWidthUnit(self) Qgis.RenderUnit

Gets the unit for the arrow start width

Return type:

Qgis.RenderUnit

arrowStartWidthUnitScale(self) QgsMapUnitScale

Gets the scale for the arrow start width

Return type:

QgsMapUnitScale

arrowType(self) QgsArrowSymbolLayer.ArrowType

Gets the current arrow type

Return type:

QgsArrowSymbolLayer.ArrowType

arrowWidth(self) float

Gets current arrow width

Return type:

float

arrowWidthUnit(self) Qgis.RenderUnit

Gets the unit for the arrow width

Return type:

Qgis.RenderUnit

arrowWidthUnitScale(self) QgsMapUnitScale

Gets the scale for the arrow width

Return type:

QgsMapUnitScale

canCauseArtifactsBetweenAdjacentTiles(self) bool
Return type:

bool

clone(self) QgsArrowSymbolLayer | None
Return type:

Optional[QgsArrowSymbolLayer]

color(self) QColor
Return type:

QColor

copyDataDefinedProperties(self, destLayer: QgsSymbolLayer | None)

Copies all data defined properties of this layer to another symbol layer.

Parameters:

destLayer – destination layer

copyPaintEffect(self, destLayer: QgsSymbolLayer | None)

Copies paint effect of this layer to another symbol layer

Parameters:

destLayer – destination layer

create(properties: Dict[str, Any] = {}) QgsSymbolLayer | None

Create a new QgsArrowSymbolLayer

Parameters:

properties (Dict[str) – A property map to deserialize saved information from properties()

Return type:

Optional[QgsSymbolLayer]

Returns:

A new QgsArrowSymbolLayer

hasDataDefinedProperties(self) bool
Return type:

bool

headLength(self) float

Gets the current arrow head length

Return type:

float

headLengthUnit(self) Qgis.RenderUnit

Gets the unit for the head length

Return type:

Qgis.RenderUnit

headLengthUnitScale(self) QgsMapUnitScale

Gets the scale for the head length

Return type:

QgsMapUnitScale

headThickness(self) float

Gets the current arrow head height

Return type:

float

headThicknessUnit(self) Qgis.RenderUnit

Gets the unit for the head height

Return type:

Qgis.RenderUnit

headThicknessUnitScale(self) QgsMapUnitScale

Gets the scale for the head height

Return type:

QgsMapUnitScale

headType(self) QgsArrowSymbolLayer.HeadType

Gets the current head type

Return type:

QgsArrowSymbolLayer.HeadType

installMasks(self, context: QgsRenderContext, recursive: bool)

When rendering, install masks on context painter if recursive is True masks are installed recursively for all children symbol layers

See also

prepareMasks()

See also

removeMasks()

Added in version 3.30.

isCurved(self) bool

Returns whether it is a curved arrow or a straight one

Return type:

bool

isRepeated(self) bool

Returns whether the arrow is repeated along the line or not

Return type:

bool

layerType(self) str
Return type:

str

properties(self) Dict[str, Any]
Return type:

Dict[str, Any]

removeMasks(self, context: QgsRenderContext, recursive: bool)

When rendering, remove previously installed masks from context painter if recursive is True masks are removed recursively for all children symbol layers

See also

prepareMasks()

See also

installMasks()

Added in version 3.30.

renderPolyline(self, points: QPolygonF, context: QgsSymbolRenderContext)
Parameters:
restoreOldDataDefinedProperties(self, stringMap: Dict[str, Any])

Restores older data defined properties from string map.

setArrowStartWidth(self, width: float)

Sets the arrow start width

Parameters:

width (float)

setArrowStartWidthUnit(self, unit: Qgis.RenderUnit)

Sets the unit for the arrow start width

Parameters:

unit (Qgis.RenderUnit)

setArrowStartWidthUnitScale(self, scale: QgsMapUnitScale)

Sets the scale for the arrow start width

Parameters:

scale (QgsMapUnitScale)

setArrowType(self, type: QgsArrowSymbolLayer.ArrowType)

Sets the arrow type

Parameters:

type (QgsArrowSymbolLayer.ArrowType)

setArrowWidth(self, width: float)

Sets the arrow width

Parameters:

width (float)

setArrowWidthUnit(self, unit: Qgis.RenderUnit)

Sets the unit for the arrow width

Parameters:

unit (Qgis.RenderUnit)

setArrowWidthUnitScale(self, scale: QgsMapUnitScale)

Sets the scale for the arrow width

Parameters:

scale (QgsMapUnitScale)

setColor(self, c: QColor | Qt.GlobalColor)
Parameters:

c (Union[QColor)

setHeadLength(self, length: float)

Sets the arrow head length

Parameters:

length (float)

setHeadLengthUnit(self, unit: Qgis.RenderUnit)

Sets the unit for the head length

Parameters:

unit (Qgis.RenderUnit)

setHeadLengthUnitScale(self, scale: QgsMapUnitScale)

Sets the scale for the head length

Parameters:

scale (QgsMapUnitScale)

setHeadThickness(self, thickness: float)

Sets the arrow head height

Parameters:

thickness (float)

setHeadThicknessUnit(self, unit: Qgis.RenderUnit)

Sets the unit for the head height

Parameters:

unit (Qgis.RenderUnit)

setHeadThicknessUnitScale(self, scale: QgsMapUnitScale)

Sets the scale for the head height

Parameters:

scale (QgsMapUnitScale)

setHeadType(self, type: QgsArrowSymbolLayer.HeadType)

Sets the head type

Parameters:

type (QgsArrowSymbolLayer.HeadType)

setIsCurved(self, isCurved: bool)

Sets whether it is a curved arrow or a straight one

Parameters:

isCurved (bool)

setIsRepeated(self, isRepeated: bool)

Sets whether the arrow is repeated along the line

Parameters:

isRepeated (bool)

setOutputUnit(self, unit: Qgis.RenderUnit)
Parameters:

unit (Qgis.RenderUnit)

setSubSymbol(self, symbol: QgsSymbol | None) bool
Parameters:

symbol (Optional[QgsSymbol])

Return type:

bool

shouldRenderUsingSelectionColor(self, context: QgsSymbolRenderContext) bool

Returns True if the symbol layer should be rendered using the selection color from the render context.

Added in version 3.34.

startRender(self, context: QgsSymbolRenderContext)
Parameters:

context (QgsSymbolRenderContext)

stopRender(self, context: QgsSymbolRenderContext)
Parameters:

context (QgsSymbolRenderContext)

subSymbol(self) QgsSymbol | None
Return type:

Optional[QgsSymbol]

usedAttributes(self, context: QgsRenderContext) Set[str]
Parameters:

context (QgsRenderContext)

Return type:

Set[str]

usesMapUnits(self) bool
Return type:

bool