Class: QgsLineSymbolLayer

class qgis.core.QgsLineSymbolLayer(locked: bool = False)

Bases: QgsSymbolLayer

QgsLineSymbolLayer(QgsLineSymbolLayer)

Parameters

locked

AllRings = 0
ExteriorRingOnly = 1
InteriorRingsOnly = 2
class RenderRingFilter

Bases: int

copyDataDefinedProperties()
copyPaintEffect()
drawPreviewIcon(self, context: QgsSymbolRenderContext, size: QSize)
Parameters
dxfWidth(self, e: QgsDxfExport, context: QgsSymbolRenderContext) → float
Parameters
Return type

float

mapUnitScale(self) → QgsMapUnitScale
Return type

QgsMapUnitScale

offset(self) → float
Return type

float

offsetMapUnitScale(self) → QgsMapUnitScale
Return type

QgsMapUnitScale

offsetUnit(self) → QgsUnitTypes.RenderUnit

Returns the units for the line’s offset.

See also

setOffsetUnit()

Return type

QgsUnitTypes.RenderUnit

outputUnit(self) → QgsUnitTypes.RenderUnit
Return type

QgsUnitTypes.RenderUnit

renderPolygonStroke(self, points: QPolygonF, rings: Iterable[QPolygonF], context: QgsSymbolRenderContext)
Parameters
renderPolyline(self, points: QPolygonF, context: QgsSymbolRenderContext)
Parameters
restoreOldDataDefinedProperties()
ringFilter(self) → QgsLineSymbolLayer.RenderRingFilter

Returns the line symbol layer’s ring filter, which controls which rings are rendered when the line symbol is being used to draw a polygon’s rings.

This setting has no effect when the line symbol is not being rendered for a polygon.

See also

setRingFilter()

New in version 3.4.3.

Return type

QgsLineSymbolLayer.RenderRingFilter

setMapUnitScale(self, scale: QgsMapUnitScale)
Parameters

scale (QgsMapUnitScale) –

setOffset(self, offset: float)
Parameters

offset (float) –

setOffsetMapUnitScale(self, scale: QgsMapUnitScale)
Parameters

scale (QgsMapUnitScale) –

setOffsetUnit(self, unit: QgsUnitTypes.RenderUnit)

Sets the units for the line’s offset.

Parameters

unit (QgsUnitTypes.RenderUnit) – offset units

See also

offsetUnit()

setOutputUnit(self, unit: QgsUnitTypes.RenderUnit)
Parameters

unit (QgsUnitTypes.RenderUnit) –

setRingFilter(self, filter: QgsLineSymbolLayer.RenderRingFilter)

Sets the line symbol layer’s ring filter, which controls which rings are rendered when the line symbol is being used to draw a polygon’s rings.

This setting has no effect when the line symbol is not being rendered for a polygon.

See also

ringFilter()

New in version 3.4.3.

Parameters

filter (QgsLineSymbolLayer.RenderRingFilter) –

setWidth(self, width: float)
Parameters

width (float) –

setWidthMapUnitScale(self, scale: QgsMapUnitScale)
Parameters

scale (QgsMapUnitScale) –

setWidthUnit(self, unit: QgsUnitTypes.RenderUnit)

Sets the units for the line’s width.

Parameters

unit (QgsUnitTypes.RenderUnit) – width units

See also

widthUnit()

width(self) → float

Returns the estimated width for the line symbol layer.

Warning

This returned value is inaccurate if the symbol layer has sub-symbols with different width units. Use the overload accepting a QgsRenderContext argument instead for accurate sizes in this case.

See also

setWidth()

width(self, context: QgsRenderContext) -> float Returns the line symbol layer width, in painter units.

This method returns an accurate width by calculating the actual rendered width of the symbol layer using the provided render context.

See also

setWidth()

New in version 3.4.5.

Return type

float

widthMapUnitScale(self) → QgsMapUnitScale
Return type

QgsMapUnitScale

widthUnit(self) → QgsUnitTypes.RenderUnit

Returns the units for the line’s width.

See also

setWidthUnit()

Return type

QgsUnitTypes.RenderUnit