QgsVectorFieldSymbolLayer class

A symbol layer class for displaying displacement arrows based on point layer attributes.

Contents

Base classes

class QgsMarkerSymbolLayer
Abstract base class for marker symbol layers.

Public functions

auto bounds(QPointF point, QgsSymbolRenderContext& context) -> QRectF override
Returns the approximate bounding box of the marker symbol layer, taking into account any data defined overrides and offsets which are set for the marker layer.
auto clone() const -> QgsVectorFieldSymbolLayer* override
Shall be reimplemented by subclasses to create a deep copy of the instance.
auto color() const -> QColor override
The fill color.
auto distanceUnit() const -> QgsUnitTypes::RenderUnit
Returns the units for the distance.
auto layerType() const -> QString override
Returns a string that represents this layer type.
auto outputUnit() const -> QgsUnitTypes::RenderUnit override
Returns the units to use for sizes and widths within the symbol layer.
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 renderPoint(QPointF point, QgsSymbolRenderContext& context) override
Renders a marker at the specified point.
void setColor(const QColor& color) override
The fill color.
void setDistanceUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the distance.
void setOutputUnit(QgsUnitTypes::RenderUnit unit) override
Sets the units to use for sizes and widths within the symbol layer.
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

QRectF QgsVectorFieldSymbolLayer::bounds(QPointF point, QgsSymbolRenderContext& context) override

Returns the approximate bounding box of the marker symbol layer, taking into account any data defined overrides and offsets which are set for the marker layer.

Returns approximate symbol bounds, in painter units

QgsUnitTypes::RenderUnit QgsVectorFieldSymbolLayer::distanceUnit() const

Returns the units for the distance.

QString QgsVectorFieldSymbolLayer::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.

QgsUnitTypes::RenderUnit QgsVectorFieldSymbolLayer::outputUnit() const override

Returns the units to use for sizes and widths within the symbol layer.

Returns output unit, or QgsUnitTypes::RenderUnknownUnit if the symbol layer contains mixed units

Individual symbol layer subclasses will interpret this in different ways, e.g., a marker symbol layer may use it to specify the units for the marker size, while a line symbol layer may use it to specify the units for the line width.

QgsStringMap QgsVectorFieldSymbolLayer::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.

void QgsVectorFieldSymbolLayer::renderPoint(QPointF point, QgsSymbolRenderContext& context) override

Renders a marker at the specified point.

Parameters
point position at which to render point, in painter units
context symbol render context

Derived classes must implement this to handle drawing the point.

void QgsVectorFieldSymbolLayer::setDistanceUnit(QgsUnitTypes::RenderUnit unit)

Sets the units for the distance.

Parameters
unit distance units

void QgsVectorFieldSymbolLayer::setOutputUnit(QgsUnitTypes::RenderUnit unit) override

Sets the units to use for sizes and widths within the symbol layer.

Parameters
unit output units

Individual symbol layer subclasses will interpret this in different ways, e.g., a marker symbol layer may use it to specify the units for the marker size, while a line symbol layer may use it to specify the units for the line width.

QSet<QString> QgsVectorFieldSymbolLayer::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.