Class: QgsLinePatternFillSymbolLayer

class qgis.core.QgsLinePatternFillSymbolLayer

Bases: QgsImageFillSymbolLayer

A symbol fill consisting of repeated parallel lines.

Methods

applyBrushTransformFromContext

applyDataDefinedSettings

param context:

clipMode

Returns the line clipping mode, which defines how lines are clipped at the edges of shapes.

clone

rtype:

QgsLinePatternFillSymbolLayer

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

Creates a new QgsLinePatternFillSymbolLayer from a properties map.

createFromSld

Creates a new QgsLinePatternFillSymbolLayer from a SLD element.

distance

Returns the distance between lines in the fill pattern.

distanceMapUnitScale

Returns the map unit scale for the pattern's line distance.

distanceUnit

Returns the units for the distance between lines in the fill pattern.

estimateMaxBleed

param context:

hasDataDefinedProperties

rtype:

bool

installMasks

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

layerType

rtype:

str

lineAngle

Returns the angle for the parallel lines used to fill the symbol.

lineWidth

Returns the width of the line subsymbol used to render the parallel lines in the fill.

lineWidthMapUnitScale

Returns the map unit scale for the pattern's line width.

lineWidthUnit

Returns the units for the line's width.

mapUnitScale

rtype:

QgsMapUnitScale

offset

Returns the offset distance for lines within the fill, which is the distance to offset the parallel lines from their normal position.

offsetMapUnitScale

Returns the map unit scale for the pattern's line offset.

offsetUnit

Returns the units for the line pattern's offset.

ogrFeatureStyleWidth

param widthScaleFactor:

outputUnit

rtype:

Qgis.RenderUnit

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

renderPolygon

param points:

restoreOldDataDefinedProperties

Restores older data defined properties from string map.

setClipMode

Sets the line clipping mode, which defines how lines are clipped at the edges of shapes.

setColor

param c:

setDistance

Sets the distance between lines in the fill pattern.

setDistanceMapUnitScale

Sets the map unit scale for the pattern's line distance.

setDistanceUnit

Sets the unit for the distance between lines in the fill pattern.

setLineAngle

Sets the angle for the parallel lines used to fill the symbol.

setLineWidth

Sets the width of the line subsymbol used to render the parallel lines in the fill.

setLineWidthMapUnitScale

Sets the map unit scale for the pattern's line width.

setLineWidthUnit

Sets the unit for the line's width.

setMapUnitScale

param scale:

setOffset

Sets the offset distance for lines within the fill, which is the distance to offset the parallel lines from their normal position.

setOffsetMapUnitScale

Sets the map unit scale for the pattern's line offset.

setOffsetUnit

Sets the unit for the line pattern's offset.

setOutputUnit

param unit:

setSubSymbol

param symbol:

shouldRenderUsingSelectionColor

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

startFeatureRender

param feature:

startRender

param context:

stopFeatureRender

param feature:

stopRender

param context:

subSymbol

rtype:

QgsSymbol

toSld

param doc:

toTiledPatternImage

rtype:

QImage

usedAttributes

param context:

usesMapUnits

rtype:

bool

applyBrushTransformFromContext()
applyDataDefinedSettings(self, context: QgsSymbolRenderContext)
Parameters:

context (QgsSymbolRenderContext)

clipMode(self) Qgis.LineClipMode

Returns the line clipping mode, which defines how lines are clipped at the edges of shapes.

See also

setClipMode()

Added in version 3.24.

Return type:

Qgis.LineClipMode

clone(self) QgsLinePatternFillSymbolLayer
Return type:

QgsLinePatternFillSymbolLayer

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

Creates a new QgsLinePatternFillSymbolLayer from a properties map. The caller takes ownership of the returned object.

Parameters:

properties (Dict[str)

Return type:

QgsSymbolLayer

createFromSld(element: QDomElement) QgsSymbolLayer

Creates a new QgsLinePatternFillSymbolLayer from a SLD element. The caller takes ownership of the returned object.

Parameters:

element (QDomElement)

Return type:

QgsSymbolLayer

distance(self) float

Returns the distance between lines in the fill pattern. Units are retrieved by distanceUnit().

See also

setDistance()

See also

distanceUnit()

Return type:

float

distanceMapUnitScale(self) QgsMapUnitScale

Returns the map unit scale for the pattern’s line distance.

See also

distance()

See also

distanceUnit()

Return type:

QgsMapUnitScale

distanceUnit(self) Qgis.RenderUnit

Returns the units for the distance between lines in the fill pattern.

See also

distance()

Return type:

Qgis.RenderUnit

estimateMaxBleed(self, context: QgsRenderContext) float
Parameters:

context (QgsRenderContext)

Return type:

float

hasDataDefinedProperties(self) bool
Return type:

bool

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.

layerType(self) str
Return type:

str

lineAngle(self) float

Returns the angle for the parallel lines used to fill the symbol.

Angles are in degrees, clockwise from North.

See also

setLineAngle()

Return type:

float

lineWidth(self) float

Returns the width of the line subsymbol used to render the parallel lines in the fill.

See also

setLineWidth()

Return type:

float

lineWidthMapUnitScale(self) QgsMapUnitScale

Returns the map unit scale for the pattern’s line width.

See also

lineWidth()

See also

lineWidthUnit()

Return type:

QgsMapUnitScale

lineWidthUnit(self) Qgis.RenderUnit

Returns the units for the line’s width.

Return type:

Qgis.RenderUnit

mapUnitScale(self) QgsMapUnitScale
Return type:

QgsMapUnitScale

offset(self) float

Returns the offset distance for lines within the fill, which is the distance to offset the parallel lines from their normal position.

Units are retrieved via offsetUnit().

See also

setOffset()

See also

offsetUnit()

Return type:

float

offsetMapUnitScale(self) QgsMapUnitScale

Returns the map unit scale for the pattern’s line offset.

See also

offset()

See also

offsetUnit()

Return type:

QgsMapUnitScale

offsetUnit(self) Qgis.RenderUnit

Returns the units for the line pattern’s offset.

See also

setOffsetUnit()

Return type:

Qgis.RenderUnit

ogrFeatureStyleWidth(self, widthScaleFactor: float) str
Parameters:

widthScaleFactor (float)

Return type:

str

outputUnit(self) Qgis.RenderUnit
Return type:

Qgis.RenderUnit

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.

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

Restores older data defined properties from string map.

setClipMode(self, mode: Qgis.LineClipMode)

Sets the line clipping mode, which defines how lines are clipped at the edges of shapes.

See also

clipMode()

Added in version 3.24.

Parameters:

mode (Qgis.LineClipMode)

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

c (Union[QColor)

setDistance(self, d: float)

Sets the distance between lines in the fill pattern.

Parameters:

d (float) – distance. Units are specified by setDistanceUnit()

See also

distance()

setDistanceMapUnitScale(self, scale: QgsMapUnitScale)

Sets the map unit scale for the pattern’s line distance.

See also

setDistance()

Parameters:

scale (QgsMapUnitScale)

setDistanceUnit(self, unit: Qgis.RenderUnit)

Sets the unit for the distance between lines in the fill pattern.

See also

distanceUnit()

See also

setDistance()

Parameters:

unit (Qgis.RenderUnit)

setLineAngle(self, a: float)

Sets the angle for the parallel lines used to fill the symbol.

Angles are in degrees, clockwise from North.

See also

lineAngle()

Parameters:

a (float)

setLineWidth(self, w: float)

Sets the width of the line subsymbol used to render the parallel lines in the fill.

See also

lineWidth()

Parameters:

w (float)

setLineWidthMapUnitScale(self, scale: QgsMapUnitScale)

Sets the map unit scale for the pattern’s line width.

See also

setLineWidth()

Parameters:

scale (QgsMapUnitScale)

setLineWidthUnit(self, unit: Qgis.RenderUnit)

Sets the unit for the line’s width.

See also

lineWidthUnit()

Parameters:

unit (Qgis.RenderUnit)

setMapUnitScale(self, scale: QgsMapUnitScale)
Parameters:

scale (QgsMapUnitScale)

setOffset(self, offset: float)

Sets the offset distance for lines within the fill, which is the distance to offset the parallel lines from their normal position.

Units are specified via setOffsetUnit().

See also

offset()

See also

setOffsetUnit()

Parameters:

offset (float)

setOffsetMapUnitScale(self, scale: QgsMapUnitScale)

Sets the map unit scale for the pattern’s line offset.

See also

setOffset()

See also

setOffsetUnit()

Parameters:

scale (QgsMapUnitScale)

setOffsetUnit(self, unit: Qgis.RenderUnit)

Sets the unit for the line pattern’s offset.

See also

offsetUnit()

Parameters:

unit (Qgis.RenderUnit)

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

unit (Qgis.RenderUnit)

setSubSymbol(self, symbol: QgsSymbol) bool
Parameters:

symbol (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.

startFeatureRender(self, feature: QgsFeature, context: QgsRenderContext)
Parameters:
startRender(self, context: QgsSymbolRenderContext)
Parameters:

context (QgsSymbolRenderContext)

stopFeatureRender(self, feature: QgsFeature, context: QgsRenderContext)
Parameters:
stopRender(self, context: QgsSymbolRenderContext)
Parameters:

context (QgsSymbolRenderContext)

subSymbol(self) QgsSymbol
Return type:

QgsSymbol

toSld(self, doc: QDomDocument, element: QDomElement, props: Dict[str, Any])
Parameters:
  • doc (QDomDocument)

  • element (QDomElement)

  • props (Dict[str)

toTiledPatternImage(self) QImage
Return type:

QImage

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

context (QgsRenderContext)

Return type:

Set[str]

usesMapUnits(self) bool
Return type:

bool