QgsImageFillSymbolLayer class

Base class for polygon renderers generating texture images.

Derived classes

class QgsLinePatternFillSymbolLayer
A symbol fill consisting of repeated parallel lines.
class QgsRasterFillSymbolLayer
A class for filling symbols with a repeated raster image.
class QgsSVGFillSymbolLayer
A class for filling symbols with a repeated SVG file.

Public functions

auto dxfColor(QgsSymbolRenderContext& context) const -> QColor override
Gets color.
auto dxfPenStyle() const -> Qt::PenStyle override
Gets pen style.
auto dxfWidth(const QgsDxfExport& e, QgsSymbolRenderContext& context) const -> double override
Gets line width.
auto estimateMaxBleed(const QgsRenderContext& context) const -> double override
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape when drawn in the specified /a context.
auto outputUnit() const -> QgsUnitTypes::RenderUnit override
Returns the units to use for sizes and widths within the symbol layer.
void setOutputUnit(QgsUnitTypes::RenderUnit unit) override
Sets the units to use for sizes and widths within the symbol layer.
void setStrokeWidthMapUnitScale(const QgsMapUnitScale& scale)
Sets the stroke width map unit scale.
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units fo the symbol's stroke width.
auto setSubSymbol(QgsSymbol* symbol) -> bool override
Sets layer's subsymbol. takes ownership of the passed symbol.
auto strokeWidthMapUnitScale() const -> const QgsMapUnitScale&
Returns the stroke width map unit scale.
auto strokeWidthUnit() const -> QgsUnitTypes::RenderUnit
Returns the units for the symbol's stroke width.
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.

Protected variables

std::unique_ptr<QgsLineSymbol> mStroke
Custom stroke.
double mStrokeWidth
Stroke width.

Function documentation

double QgsImageFillSymbolLayer::estimateMaxBleed(const QgsRenderContext& context) const override

Returns the estimated maximum distance which the layer style will bleed outside the drawn shape when drawn in the specified /a context.

For example, polygons drawn with an stroke will draw half the width of the stroke outside of the polygon. This amount is estimated, since it may be affected by data defined symbology rules.

QgsUnitTypes::RenderUnit QgsImageFillSymbolLayer::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.

void QgsImageFillSymbolLayer::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.

void QgsImageFillSymbolLayer::setStrokeWidthMapUnitScale(const QgsMapUnitScale& scale)

Sets the stroke width map unit scale.

void QgsImageFillSymbolLayer::setStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)

Sets the units fo the symbol's stroke width.

const QgsMapUnitScale& QgsImageFillSymbolLayer::strokeWidthMapUnitScale() const

Returns the stroke width map unit scale.

QgsUnitTypes::RenderUnit QgsImageFillSymbolLayer::strokeWidthUnit() const

Returns the units for the symbol's stroke width.

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