Class: QgsHashedLineSymbolLayer¶
- class qgis.core.QgsHashedLineSymbolLayer¶
Bases:
QgsTemplatedLineSymbolLayerBase
Line symbol layer type which draws repeating line sections along a line feature.
New in version 3.8.
QgsHashedLineSymbolLayer(rotateSymbol: bool = True, interval: float = 3) Constructor for
QgsHashedLineSymbolLayer
. Creates a line with a default hash symbol, placed at the specifiedinterval
(in millimeters).The
rotateSymbol
argument specifies whether individual hash symbols should be rotated to match the line segment alignment.Methods
- rtype
QgsHashedLineSymbolLayer
- rtype
QColor
Copies all data defined properties of this layer to another symbol layer.
Copies paint effect of this layer to another symbol layer
Copies all common properties of this layer to another templated symbol layer.
Creates a new
QgsHashedLineSymbolLayer
, using the settings serialized in theproperties
map (corresponding to the output fromQgsHashedLineSymbolLayer.properties()
).- param context
- rtype
bool
Returns the angle to use when drawing the hashed lines sections, in degrees clockwise.
Returns the length of hash symbols.
Returns the map unit scale for the hash length.
Returns the units for the length of hash symbols.
- rtype
str
- rtype
Dict[str, Any]
- param points
- param point
Restores older data defined properties from string map.
- param color
Sets all common symbol properties in the
destLayer
, using the settings serialized in theproperties
map.- param key
Sets the
angle
to use when drawing the hashed lines sections, in degrees clockwise.Sets the
length
of hash symbols.Sets the map unit
scale
for the hash length.Sets the
unit
for the length of hash symbols.- param unit
- param symbol
- param angle
- param angle
- param width
- param context
- param context
- rtype
QgsSymbol
- rtype
float
- param context
- rtype
bool
- rtype
float
- clone(self) QgsHashedLineSymbolLayer ¶
- Return type
- 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
New in version 2.9.
- copyTemplateSymbolProperties(self, destLayer: QgsTemplatedLineSymbolLayerBase)¶
Copies all common properties of this layer to another templated symbol layer.
- create(properties: Dict[str, Any] = {}) QgsSymbolLayer ¶
Creates a new
QgsHashedLineSymbolLayer
, using the settings serialized in theproperties
map (corresponding to the output fromQgsHashedLineSymbolLayer.properties()
).- Parameters
properties (Dict[str) –
- Return type
- estimateMaxBleed(self, context: QgsRenderContext) float ¶
- Parameters
context (QgsRenderContext) –
- Return type
float
- hasDataDefinedProperties(self) bool ¶
- Return type
bool
- hashAngle(self) float ¶
Returns the angle to use when drawing the hashed lines sections, in degrees clockwise.
See also
- Return type
float
- hashLength(self) float ¶
Returns the length of hash symbols. Units are specified through
hashLengthUnits()
.See also
See also
- Return type
float
- hashLengthMapUnitScale(self) QgsMapUnitScale ¶
Returns the map unit scale for the hash length.
See also
See also
See also
- Return type
- hashLengthUnit(self) QgsUnitTypes.RenderUnit ¶
Returns the units for the length of hash symbols.
See also
See also
- Return type
- layerType(self) str ¶
- Return type
str
- properties(self) Dict[str, Any] ¶
- Return type
Dict[str, Any]
- renderPolyline(self, points: QPolygonF, context: QgsSymbolRenderContext)¶
- Parameters
points (QPolygonF) –
context (QgsSymbolRenderContext) –
- renderSymbol(self, point: Union[QPointF, QPoint], feature: QgsFeature, context: QgsRenderContext, layer: int = -1, selected: bool = False)¶
- Parameters
point (Union[QPointF) –
feature (QgsFeature) –
context (QgsRenderContext) –
layer (int = -1) –
selected (bool = False) –
- restoreOldDataDefinedProperties(self, stringMap: Dict[str, Any])¶
Restores older data defined properties from string map.
New in version 3.0.
- setColor(self, color: Union[QColor, Qt.GlobalColor, QGradient])¶
- Parameters
color (Union[QColor) –
- setCommonProperties(destLayer: QgsTemplatedLineSymbolLayerBase, properties: Dict[str, Any])¶
Sets all common symbol properties in the
destLayer
, using the settings serialized in theproperties
map.
- setDataDefinedProperty(self, key: QgsSymbolLayer.Property, property: QgsProperty)¶
- Parameters
key (QgsSymbolLayer.Property) –
property (QgsProperty) –
- setHashAngle(self, angle: float)¶
Sets the
angle
to use when drawing the hashed lines sections, in degrees clockwise.See also
- Parameters
angle (float) –
- setHashLength(self, length: float)¶
Sets the
length
of hash symbols. Units are specified throughsetHashLengthUnit()
See also
See also
- Parameters
length (float) –
- setHashLengthMapUnitScale(self, scale: QgsMapUnitScale)¶
Sets the map unit
scale
for the hash length.See also
See also
See also
- Parameters
scale (QgsMapUnitScale) –
- setHashLengthUnit(self, unit: QgsUnitTypes.RenderUnit)¶
Sets the
unit
for the length of hash symbols.See also
See also
- Parameters
unit (QgsUnitTypes.RenderUnit) –
- setOutputUnit(self, unit: QgsUnitTypes.RenderUnit)¶
- Parameters
unit (QgsUnitTypes.RenderUnit) –
- setSymbolAngle(self, angle: float)¶
- Parameters
angle (float) –
- setSymbolLineAngle(self, angle: float)¶
- Parameters
angle (float) –
- setWidth(self, width: float)¶
- Parameters
width (float) –
- startRender(self, context: QgsSymbolRenderContext)¶
- Parameters
context (QgsSymbolRenderContext) –
- stopRender(self, context: QgsSymbolRenderContext)¶
- Parameters
context (QgsSymbolRenderContext) –
- symbolAngle(self) float ¶
- Return type
float
- usedAttributes(self, context: QgsRenderContext) Set[str] ¶
- Parameters
context (QgsRenderContext) –
- Return type
Set[str]
- usesMapUnits(self) bool ¶
- Return type
bool
- width(self) float ¶
- width(self, context: QgsRenderContext) float
- Return type
float