Class: QgsSimpleLineSymbolLayer¶
A simple line symbol layer, which renders lines using a line in a variety of styles (e.g. solid, dotted, dashed).
Class Hierarchy¶
Base classes¶
Abstract base class for line symbol layers. |
|
Abstract base class for symbol layers. |
Methods
Returns |
|
Returns the map unit scale for lengths used in the custom dash pattern. |
|
Returns the units for lengths used in the custom dash pattern. |
|
Returns the custom dash vector, which is the pattern of alternating drawn/skipped lengths used while rendering a custom dash pattern. |
|
Returns the dash pattern offset, which dictates how far along the dash pattern the pattern should start rendering at. |
|
Returns the map unit scale for the dash pattern offset value. |
|
Returns the units for the dash pattern offset. |
|
Returns |
|
Returns the pen cap style used to render the line (e.g. flat, square, round, etc). |
|
Returns the pen join style used to render the line (e.g. miter, bevel, round, etc). |
|
Returns the pen style used to render the line (e.g. solid, dashed, etc). |
|
Sets whether dash patterns should be aligned to the start and end of lines, by applying subtle tweaks to the pattern sizing in order to ensure that the end of a line is represented by a complete dash element. |
|
Sets the map unit scale for lengths used in the custom dash pattern. |
|
Sets the unit for lengths used in the custom dash pattern. |
|
Sets the custom dash vector, which is the pattern of alternating drawn/skipped lengths used while rendering a custom dash pattern. |
|
Sets the dash pattern offset, which dictates how far along the dash pattern the pattern should start rendering at. |
|
Sets the map unit scale for the dash pattern offset. |
|
Sets the unit for the dash pattern offset. |
|
Sets whether the line should only be drawn inside polygons, and any portion of the line which falls outside the polygon should be clipped away. |
|
Sets the pen cap style used to render the line (e.g. flat, square, round, etc). |
|
Sets the pen join style used to render the line (e.g. miter, bevel, round, etc). |
|
Sets the pen style used to render the line (e.g. solid, dashed, etc). |
|
Sets the trim distance for the end of the line, which dictates a length from the end of the line at which the actual rendering should end. |
|
Sets the map unit scale for the trim distance for the end of the line. |
|
Sets the unit for the trim distance for the end of the line. |
|
Sets the trim distance for the start of the line, which dictates a length from the start of the line at which the actual rendering should start. |
|
Sets the map unit scale for the trim distance for the start of the line. |
|
Sets the unit for the trim distance for the start of the line. |
|
Sets whether dash patterns tweaks should be applied on sharp corners, to ensure that a double-length dash is drawn running into and out of the corner. |
|
Sets whether the line uses a custom dash pattern. |
|
Returns the trim distance for the end of the line, which dictates a length from the end of the line at which the actual rendering should end. |
|
Returns the map unit scale for the trim distance for the end of the line. |
|
Returns the unit for the trim distance for the end of the line. |
|
Returns the trim distance for the start of the line, which dictates a length from the start of the line at which the actual rendering should start. |
|
Returns the map unit scale for the trim distance for the start of the line. |
|
Returns the unit for the trim distance for the start of the line. |
|
Returns |
|
Returns |
Static Methods
Creates a new |
|
Creates a new |
- class qgis.core.QgsSimpleLineSymbolLayer[source]¶
Bases:
QgsLineSymbolLayer
- __init__(color: QColor | Qt.GlobalColor = DEFAULT_SIMPLELINE_COLOR, width: float = DEFAULT_SIMPLELINE_WIDTH, penStyle: Qt.PenStyle = DEFAULT_SIMPLELINE_PENSTYLE)
Constructor for QgsSimpleLineSymbolLayer. Creates a simple line symbol in the specified
color
,width
(in millimeters) andpenStyle
.- Parameters:
color (Union[QColor, Qt.GlobalColor] = DEFAULT_SIMPLELINE_COLOR)
width (float = DEFAULT_SIMPLELINE_WIDTH)
penStyle (Qt.PenStyle = DEFAULT_SIMPLELINE_PENSTYLE)
- alignDashPattern(self) bool [source]¶
Returns
True
if dash patterns should be aligned to the start and end of lines, by applying subtle tweaks to the pattern sizing in order to ensure that the end of a line is represented by a complete dash element.See also
See also
Added in version 3.16.
- Return type:
bool
- static create(properties: Dict[str, Any] = {}) QgsSymbolLayer | None [source]¶
Creates a new
QgsSimpleLineSymbolLayer
, using the settings serialized in theproperties
map (corresponding to the output fromQgsSimpleLineSymbolLayer.properties()
).- Parameters:
properties (Dict[str, Any] = {})
- Return type:
Optional[QgsSymbolLayer]
- static createFromSld(element: QDomElement) QgsSymbolLayer | None [source]¶
Creates a new
QgsSimpleLineSymbolLayer
from an SLD XML DOMelement
.- Parameters:
element (QDomElement)
- Return type:
Optional[QgsSymbolLayer]
- customDashPatternMapUnitScale(self) QgsMapUnitScale ¶
Returns the map unit scale for lengths used in the custom dash pattern.
See also
- Return type:
- customDashPatternUnit(self) Qgis.RenderUnit [source]¶
Returns the units for lengths used in the custom dash pattern.
See also
- Return type:
- customDashVector(self) List[float] ¶
Returns the custom dash vector, which is the pattern of alternating drawn/skipped lengths used while rendering a custom dash pattern.
Units for the vector are specified by
customDashPatternUnit()
This setting is only used when
useCustomDashPattern()
returnsTrue
.See also
See also
See also
- Return type:
List[float]
- dashPatternOffset(self) float [source]¶
Returns the dash pattern offset, which dictates how far along the dash pattern the pattern should start rendering at.
Offset units can be retrieved by calling
dashPatternOffsetUnit()
.See also
See also
See also
Added in version 3.16.
- Return type:
float
- dashPatternOffsetMapUnitScale(self) QgsMapUnitScale ¶
Returns the map unit scale for the dash pattern offset value.
See also
See also
See also
Added in version 3.16.
- Return type:
- dashPatternOffsetUnit(self) Qgis.RenderUnit [source]¶
Returns the units for the dash pattern offset.
See also
See also
See also
Added in version 3.16.
- Return type:
- drawInsidePolygon(self) bool [source]¶
Returns
True
if the line should only be drawn inside polygons, and any portion of the line which falls outside the polygon should be clipped away.This setting only has an effect when the line symbol is being used to render polygon rings.
See also
- Return type:
bool
- penCapStyle(self) Qt.PenCapStyle [source]¶
Returns the pen cap style used to render the line (e.g. flat, square, round, etc).
See also
- Return type:
Qt.PenCapStyle
- penJoinStyle(self) Qt.PenJoinStyle [source]¶
Returns the pen join style used to render the line (e.g. miter, bevel, round, etc).
See also
- Return type:
Qt.PenJoinStyle
- penStyle(self) Qt.PenStyle [source]¶
Returns the pen style used to render the line (e.g. solid, dashed, etc).
See also
- Return type:
Qt.PenStyle
- setAlignDashPattern(self, enabled: bool)[source]¶
Sets whether dash patterns should be aligned to the start and end of lines, by applying subtle tweaks to the pattern sizing in order to ensure that the end of a line is represented by a complete dash element.
See also
See also
Added in version 3.16.
- Parameters:
enabled (bool)
- setCustomDashPatternMapUnitScale(self, scale: QgsMapUnitScale)[source]¶
Sets the map unit
scale
for lengths used in the custom dash pattern.See also
- Parameters:
scale (QgsMapUnitScale)
- setCustomDashPatternUnit(self, unit: Qgis.RenderUnit)[source]¶
Sets the
unit
for lengths used in the custom dash pattern.See also
- Parameters:
unit (Qgis.RenderUnit)
- setCustomDashVector(self, vector: Iterable[float])[source]¶
Sets the custom dash
vector
, which is the pattern of alternating drawn/skipped lengths used while rendering a custom dash pattern.Units for the vector are specified by
customDashPatternUnit()
This setting is only used when
useCustomDashPattern()
returnsTrue
.See also
See also
See also
- Parameters:
vector (Iterable[float])
- setDashPatternOffset(self, offset: float)[source]¶
Sets the dash pattern
offset
, which dictates how far along the dash pattern the pattern should start rendering at.Offset units are set via
setDashPatternOffsetUnit()
.See also
See also
See also
Added in version 3.16.
- Parameters:
offset (float)
- setDashPatternOffsetMapUnitScale(self, scale: QgsMapUnitScale)[source]¶
Sets the map unit
scale
for the dash pattern offset.See also
See also
See also
Added in version 3.16.
- Parameters:
scale (QgsMapUnitScale)
- setDashPatternOffsetUnit(self, unit: Qgis.RenderUnit)[source]¶
Sets the
unit
for the dash pattern offset.See also
See also
See also
Added in version 3.16.
- Parameters:
unit (Qgis.RenderUnit)
- setDrawInsidePolygon(self, drawInsidePolygon: bool)[source]¶
Sets whether the line should only be drawn inside polygons, and any portion of the line which falls outside the polygon should be clipped away.
This setting only has an effect when the line symbol is being used to render polygon rings.
See also
- Parameters:
drawInsidePolygon (bool)
- setPenCapStyle(self, style: Qt.PenCapStyle)[source]¶
Sets the pen cap
style
used to render the line (e.g. flat, square, round, etc).See also
- Parameters:
style (Qt.PenCapStyle)
- setPenJoinStyle(self, style: Qt.PenJoinStyle)[source]¶
Sets the pen join
style
used to render the line (e.g. miter, bevel, round, etc).See also
- Parameters:
style (Qt.PenJoinStyle)
- setPenStyle(self, style: Qt.PenStyle)[source]¶
Sets the pen
style
used to render the line (e.g. solid, dashed, etc).See also
- Parameters:
style (Qt.PenStyle)
- setTrimDistanceEnd(self, distance: float)[source]¶
Sets the trim
distance
for the end of the line, which dictates a length from the end of the line at which the actual rendering should end.Trim units can be set by calling
setTrimDistanceEndUnit()
.See also
See also
See also
See also
Added in version 3.20.
- Parameters:
distance (float)
- setTrimDistanceEndMapUnitScale(self, scale: QgsMapUnitScale)[source]¶
Sets the map unit
scale
for the trim distance for the end of the line.See also
See also
See also
See also
Added in version 3.20.
- Parameters:
scale (QgsMapUnitScale)
- setTrimDistanceEndUnit(self, unit: Qgis.RenderUnit)[source]¶
Sets the
unit
for the trim distance for the end of the line.See also
See also
See also
See also
Added in version 3.20.
- Parameters:
unit (Qgis.RenderUnit)
- setTrimDistanceStart(self, distance: float)[source]¶
Sets the trim
distance
for the start of the line, which dictates a length from the start of the line at which the actual rendering should start.Trim units can be set by calling
setTrimDistanceStartUnit()
.See also
See also
See also
See also
Added in version 3.20.
- Parameters:
distance (float)
- setTrimDistanceStartMapUnitScale(self, scale: QgsMapUnitScale)[source]¶
Sets the map unit
scale
for the trim distance for the start of the line.See also
See also
See also
See also
Added in version 3.20.
- Parameters:
scale (QgsMapUnitScale)
- setTrimDistanceStartUnit(self, unit: Qgis.RenderUnit)[source]¶
Sets the
unit
for the trim distance for the start of the line.See also
See also
See also
See also
Added in version 3.20.
- Parameters:
unit (Qgis.RenderUnit)
- setTweakDashPatternOnCorners(self, enabled: bool)[source]¶
Sets whether dash patterns tweaks should be applied on sharp corners, to ensure that a double-length dash is drawn running into and out of the corner.
Note
This setting is only applied if
alignDashPattern()
isTrue
.See also
See also
Added in version 3.16.
- Parameters:
enabled (bool)
- setUseCustomDashPattern(self, b: bool)[source]¶
Sets whether the line uses a custom dash pattern.
See also
See also
See also
- Parameters:
b (bool)
- trimDistanceEnd(self) float [source]¶
Returns the trim distance for the end of the line, which dictates a length from the end of the line at which the actual rendering should end.
Trim units can be retrieved by calling
trimDistanceEndUnit()
.See also
See also
See also
See also
Added in version 3.20.
- Return type:
float
- trimDistanceEndMapUnitScale(self) QgsMapUnitScale ¶
Returns the map unit scale for the trim distance for the end of the line.
See also
See also
See also
See also
Added in version 3.20.
- Return type:
- trimDistanceEndUnit(self) Qgis.RenderUnit [source]¶
Returns the unit for the trim distance for the end of the line.
See also
See also
See also
See also
Added in version 3.20.
- Return type:
- trimDistanceStart(self) float [source]¶
Returns the trim distance for the start of the line, which dictates a length from the start of the line at which the actual rendering should start.
Trim units can be retrieved by calling
trimDistanceStartUnit()
.See also
See also
See also
See also
Added in version 3.20.
- Return type:
float
- trimDistanceStartMapUnitScale(self) QgsMapUnitScale ¶
Returns the map unit scale for the trim distance for the start of the line.
See also
See also
See also
See also
Added in version 3.20.
- Return type:
- trimDistanceStartUnit(self) Qgis.RenderUnit [source]¶
Returns the unit for the trim distance for the start of the line.
See also
See also
See also
See also
Added in version 3.20.
- Return type:
- tweakDashPatternOnCorners(self) bool [source]¶
Returns
True
if dash patterns tweaks should be applied on sharp corners, to ensure that a double-length dash is drawn running into and out of the corner.Note
This setting is only applied if
alignDashPattern()
isTrue
.See also
See also
Added in version 3.16.
- Return type:
bool