Class: QgsLineSymbolLayer¶
Abstract base class for line symbol layers.
Class Hierarchy¶
Base classes¶
Constructor for QgsSymbolLayer. |
Subclasses¶
Base class for line symbol layer types which draws line sections using a QBrush. |
|
Line symbol layer used for representing lines as arrows. |
|
A line symbol layer type which fills a stroked line with a |
|
Base class for templated line symbols, e.g. line symbols which draw markers or hash lines at intervals along the line feature. |
|
A symbol layer that represents vector layer line feature as interpolated line The interpolation is done between two values defined at the |
|
Line symbol layer used for decorating accordingly to linear referencing. |
|
A simple line symbol layer, which renders lines using a line in a variety of styles (e.g. solid, dotted, dashed). |
Methods
Returns the line's offset. |
|
Returns the map unit scale for the line's offset. |
|
Returns the units for the line's offset. |
|
Renders the line symbol layer along the outline of polygon, using the given render context. |
|
Renders the line symbol layer along the line joining points, using the given render context. |
|
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. |
|
Sets the line's offset. |
|
Sets the map unit scale for the line's offset. |
|
Sets the unit for the line's offset. |
|
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. |
|
Sets the width of the line symbol layer. |
|
Sets the units for the line's width. |
|
Returns the estimated width for the line symbol layer. |
|
Returns the units for the line's width. |
Attributes
- class qgis.core.QgsLineSymbolLayer[source]¶
Bases:
QgsSymbolLayer
- AllRings = 0¶
- ExteriorRingOnly = 1¶
- InteriorRingsOnly = 2¶
- class RenderRingFilter¶
Bases:
int
- offset(self) float [source]¶
Returns the line’s offset.
Offset units can be retrieved by calling
offsetUnit()
.See also
See also
See also
- Return type:
float
- offsetMapUnitScale(self) QgsMapUnitScale ¶
Returns the map unit scale for the line’s offset.
See also
See also
See also
- Return type:
- offsetUnit(self) Qgis.RenderUnit [source]¶
Returns the units for the line’s offset.
See also
See also
See also
- Return type:
- renderPolygonStroke(self, points: QPolygonF, rings: Iterable[QPolygonF] | None, context: QgsSymbolRenderContext)[source]¶
Renders the line symbol layer along the outline of polygon, using the given render
context
.The exterior ring of the polygon is specified in
points
. Optionally, interior rings are set via therings
argument.See also
- Parameters:
points (QPolygonF)
rings (Optional[Iterable[QPolygonF]])
context (QgsSymbolRenderContext)
- renderPolyline(self, points: QPolygonF, context: QgsSymbolRenderContext)[source]¶
Renders the line symbol layer along the line joining
points
, using the given rendercontext
.See also
- Parameters:
points (QPolygonF)
context (QgsSymbolRenderContext)
- ringFilter(self) QgsLineSymbolLayer.RenderRingFilter [source]¶
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
Added in version 3.6.
- Return type:
- setOffset(self, offset: float)[source]¶
Sets the line’s
offset
.Offset units are set via
setOffsetUnit()
.See also
See also
See also
- Parameters:
offset (float)
- setOffsetMapUnitScale(self, scale: QgsMapUnitScale)[source]¶
Sets the map unit
scale
for the line’s offset.See also
See also
See also
- Parameters:
scale (QgsMapUnitScale)
- setOffsetUnit(self, unit: Qgis.RenderUnit)[source]¶
Sets the
unit
for the line’s offset.See also
See also
See also
- Parameters:
unit (Qgis.RenderUnit)
- setRingFilter(self, filter: QgsLineSymbolLayer.RenderRingFilter)[source]¶
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
Added in version 3.6.
- Parameters:
filter (QgsLineSymbolLayer.RenderRingFilter)
- setWidth(self, width: float)[source]¶
Sets the
width
of the line symbol layer.Calling this method updates the width of the line symbol layer, without changing the existing width units. It has different effects depending on the line symbol layer subclass, e.g. for a simple line layer it changes the stroke width of the line, for a marker line layer it changes the size of the markers used to draw the line.
See also
Warning
Since the width units vary, this method is useful for changing the relative width of a line symbol layer only.
- Parameters:
width (float)
- setWidthMapUnitScale(self, scale: QgsMapUnitScale)[source]¶
- Parameters:
scale (QgsMapUnitScale)
- setWidthUnit(self, unit: Qgis.RenderUnit)[source]¶
Sets the units for the line’s width.
- Parameters:
unit (Qgis.RenderUnit) – width units
See also
- width(self) float [source]¶
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
- Return type:
float
- width(self, context: QgsRenderContext) float [source]
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
Added in version 3.4.5.
- Parameters:
context (
QgsRenderContext
)- Return type:
float
- widthMapUnitScale(self) QgsMapUnitScale ¶
- Return type:
- widthUnit(self) Qgis.RenderUnit [source]¶
Returns the units for the line’s width.
See also
- Return type: