QgsArrowSymbolLayer class

Line symbol layer used for representing lines as arrows.

Public types

enum ArrowType { ArrowPlain, ArrowLeftHalf, ArrowRightHalf }
Possible arrow types.
enum HeadType { HeadSingle, HeadReversed, HeadDouble }
Possible head types.

Public static functions

static auto create(const QgsStringMap& properties = QgsStringMap()) -> QgsSymbolLayer*
Create a new QgsArrowSymbolLayer.

Constructors, destructors, conversion operators

QgsArrowSymbolLayer()
Simple constructor.

Public functions

auto arrowStartWidth() const -> double
Gets current arrow start width. Only meaningful for single headed arrows.
auto arrowStartWidthUnit() const -> QgsUnitTypes::RenderUnit
Gets the unit for the arrow start width.
auto arrowStartWidthUnitScale() const -> QgsMapUnitScale
Gets the scale for the arrow start width.
auto arrowType() const -> ArrowType
Gets the current arrow type.
auto arrowWidth() const -> double
Gets current arrow width.
auto arrowWidthUnit() const -> QgsUnitTypes::RenderUnit
Gets the unit for the arrow width.
auto arrowWidthUnitScale() const -> QgsMapUnitScale
Gets the scale for the arrow width.
auto clone() const -> QgsArrowSymbolLayer* override
Shall be reimplemented by subclasses to create a deep copy of the instance.
auto color() const -> QColor override
The fill color.
auto headLength() const -> double
Gets the current arrow head length.
auto headLengthUnit() const -> QgsUnitTypes::RenderUnit
Gets the unit for the head length.
auto headLengthUnitScale() const -> QgsMapUnitScale
Gets the scale for the head length.
auto headThickness() const -> double
Gets the current arrow head height.
auto headThicknessUnit() const -> QgsUnitTypes::RenderUnit
Gets the unit for the head height.
auto headThicknessUnitScale() const -> QgsMapUnitScale
Gets the scale for the head height.
auto headType() const -> HeadType
Gets the current head type.
auto isCurved() const -> bool
Returns whether it is a curved arrow or a straight one.
auto isRepeated() const -> bool
Returns whether the arrow is repeated along the line or not.
auto layerType() const -> QString override
Returns a string that represents this layer type.
auto properties() const -> QgsStringMap override
Should be reimplemented by subclasses to return a string map that contains the configuration information for the symbol layer.
void setArrowStartWidth(double width)
Sets the arrow start width.
void setArrowStartWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the arrow start width.
void setArrowStartWidthUnitScale(const QgsMapUnitScale& scale)
Sets the scale for the arrow start width.
void setArrowType(ArrowType type)
Sets the arrow type.
void setArrowWidth(double width)
Sets the arrow width.
void setArrowWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the arrow width.
void setArrowWidthUnitScale(const QgsMapUnitScale& scale)
Sets the scale for the arrow width.
void setColor(const QColor& color) override
The fill color.
void setHeadLength(double length)
Sets the arrow head length.
void setHeadLengthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the head length.
void setHeadLengthUnitScale(const QgsMapUnitScale& scale)
Sets the scale for the head length.
void setHeadThickness(double thickness)
Sets the arrow head height.
void setHeadThicknessUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the head height.
void setHeadThicknessUnitScale(const QgsMapUnitScale& scale)
Sets the scale for the head height.
void setHeadType(HeadType type)
Sets the head type.
void setIsCurved(bool isCurved)
Sets whether it is a curved arrow or a straight one.
void setIsRepeated(bool isRepeated)
Sets whether the arrow is repeated along the line.
auto setSubSymbol(QgsSymbol* symbol) -> bool override
Sets layer's subsymbol. takes ownership of the passed symbol.
auto subSymbol() -> QgsSymbol* override
Returns the symbol's sub symbol, if present.
auto usedAttributes(const QgsRenderContext& context) const -> QSet<QString> override
Returns the set of attributes referenced by the layer.

Function documentation

static QgsSymbolLayer* QgsArrowSymbolLayer::create(const QgsStringMap& properties = QgsStringMap())

Create a new QgsArrowSymbolLayer.

Parameters
properties A property map to deserialize saved information from properties()
Returns A new QgsArrowSymbolLayer

QString QgsArrowSymbolLayer::layerType() const override

Returns a string that represents this layer type.

Used for serialization. Should match with the string used to register this symbol layer in the registry.

QgsStringMap QgsArrowSymbolLayer::properties() const override

Should be reimplemented by subclasses to return a string map that contains the configuration information for the symbol layer.

This is used to serialize a symbol layer perstistently.

QSet<QString> QgsArrowSymbolLayer::usedAttributes(const QgsRenderContext& context) const override

Returns the set of attributes referenced by the layer.

This includes attributes required by any data defined properties associated with the layer.