Class: QgsArrowSymbolLayer¶
- class qgis.core.QgsArrowSymbolLayer¶
Bases:
QgsLineSymbolLayer
Line symbol layer used for representing lines as arrows.
QgsArrowSymbolLayer() Simple constructor
Methods
Gets current arrow start width.
Gets the unit for the arrow start width
Gets the scale for the arrow start width
Gets the current arrow type
Gets current arrow width
Gets the unit for the arrow width
Gets the scale for the arrow width
- rtype:
bool
- rtype:
QgsArrowSymbolLayer
- rtype:
QColor
Copies all data defined properties of this layer to another symbol layer.
Copies paint effect of this layer to another symbol layer
Create a new QgsArrowSymbolLayer
- rtype:
bool
Gets the current arrow head length
Gets the unit for the head length
Gets the scale for the head length
Gets the current arrow head height
Gets the unit for the head height
Gets the scale for the head height
Gets the current head type
When rendering, install masks on
context
painter ifrecursive
isTrue
masks are installed recursively for all children symbol layersReturns whether it is a curved arrow or a straight one
Returns whether the arrow is repeated along the line or not
- rtype:
str
- rtype:
Dict[str, Any]
When rendering, remove previously installed masks from
context
painter ifrecursive
isTrue
masks are removed recursively for all children symbol layers- param points:
Restores older data defined properties from string map.
Sets the arrow start width
Sets the unit for the arrow start width
Sets the scale for the arrow start width
Sets the arrow type
Sets the arrow width
Sets the unit for the arrow width
Sets the scale for the arrow width
- param c:
Sets the arrow head length
Sets the unit for the head length
Sets the scale for the head length
Sets the arrow head height
Sets the unit for the head height
Sets the scale for the head height
Sets the head type
Sets whether it is a curved arrow or a straight one
Sets whether the arrow is repeated along the line
- param unit:
- param symbol:
Returns
True
if the symbol layer should be rendered using the selection color from the render context.- param context:
- param context:
- rtype:
QgsSymbol
- param context:
- rtype:
bool
Attributes
- 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:
- arrowStartWidthUnitScale(self) QgsMapUnitScale ¶
Gets the scale for the arrow start width
- Return type:
- arrowType(self) QgsArrowSymbolLayer.ArrowType ¶
Gets the current arrow type
- Return type:
- arrowWidth(self) float ¶
Gets current arrow width
- Return type:
float
- arrowWidthUnit(self) Qgis.RenderUnit ¶
Gets the unit for the arrow width
- Return type:
- arrowWidthUnitScale(self) QgsMapUnitScale ¶
Gets the scale for the arrow width
- Return type:
- canCauseArtifactsBetweenAdjacentTiles(self) bool ¶
- Return type:
bool
- clone(self) QgsArrowSymbolLayer ¶
- Return type:
- color(self) QColor ¶
- Return type:
QColor
- copyDataDefinedProperties(self, destLayer: QgsSymbolLayer)¶
Copies all data defined properties of this layer to another symbol layer.
- Parameters:
destLayer – destination layer
- copyPaintEffect(self, destLayer: QgsSymbolLayer)¶
Copies paint effect of this layer to another symbol layer
- Parameters:
destLayer – destination layer
- create(properties: Dict[str, Any] = {}) QgsSymbolLayer ¶
Create a new QgsArrowSymbolLayer
- Parameters:
properties (Dict[str) – A property map to deserialize saved information from
properties()
- Return type:
- 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:
- headLengthUnitScale(self) QgsMapUnitScale ¶
Gets the scale for the head length
- Return type:
- 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:
- headThicknessUnitScale(self) QgsMapUnitScale ¶
Gets the scale for the head height
- Return type:
- headType(self) QgsArrowSymbolLayer.HeadType ¶
Gets the current head type
- Return type:
- installMasks(self, context: QgsRenderContext, recursive: bool)¶
When rendering, install masks on
context
painter ifrecursive
isTrue
masks are installed recursively for all children symbol layersSee also
prepareMasks()
See also
New 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 ifrecursive
isTrue
masks are removed recursively for all children symbol layersSee also
prepareMasks()
See also
New in version 3.30.
- renderPolyline(self, points: QPolygonF, context: QgsSymbolRenderContext)¶
- Parameters:
points (QPolygonF) –
context (QgsSymbolRenderContext) –
- 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 | QGradient)¶
- 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) –
- shouldRenderUsingSelectionColor(self, context: QgsSymbolRenderContext) bool ¶
Returns
True
if the symbol layer should be rendered using the selection color from the render context.New in version 3.34.
- startRender(self, context: QgsSymbolRenderContext)¶
- Parameters:
context (QgsSymbolRenderContext) –
- stopRender(self, context: QgsSymbolRenderContext)¶
- Parameters:
context (QgsSymbolRenderContext) –
- usedAttributes(self, context: QgsRenderContext) Set[str] ¶
- Parameters:
context (QgsRenderContext) –
- Return type:
Set[str]
- usesMapUnits(self) bool ¶
- Return type:
bool