Class: QgsLineSymbol¶
-
class
qgis.core.
QgsLineSymbol
(layers: object = QgsSymbolLayerList())¶ Bases:
QgsSymbol
Constructor for
QgsLineSymbol
, with the specified list of initial symbollayers
.Ownership of the
layers
are transferred to the symbol.A line symbol type, for rendering LineString and MultiLineString geometries.
- Parameters
layers –
-
clone
(self) → QgsLineSymbol¶ - Return type
-
cloneLayers
()¶
-
createSimple
(properties: Dict[str, str]) → QgsLineSymbol¶ Create a line symbol with one symbol layer: SimpleLine with specified properties. This is a convenience method for easier creation of line symbols.
- Parameters
properties (Dict[str) –
- Return type
-
dataDefinedWidth
(self) → QgsProperty¶ Returns data defined width for whole symbol (including all symbol layers).
- Return type
- Returns
data defined width, or invalid property if size is not set at the line level. Caller takes responsibility for deleting the returned object.
See also
New in version 3.0.
-
renderPolyline
(self, points: QPolygonF, f: QgsFeature, context: QgsRenderContext, layer: int = -1, selected: bool = False)¶ - Parameters
points (QPolygonF) –
f (QgsFeature) –
context (QgsRenderContext) –
layer (int = -1) –
selected (bool = False) –
-
renderUsingLayer
()¶
-
renderVertexMarker
()¶
-
setDataDefinedWidth
(self, property: QgsProperty)¶ Set data defined width for whole symbol (including all symbol layers).
See also
New in version 3.0.
- Parameters
property (QgsProperty) –
-
setWidth
(self, width: float)¶ Sets the
width
for the whole line symbol. Individual symbol layer sizes will be scaled to maintain their current relative size to the whole symbol size.See also
- Parameters
width (float) –
-
width
(self) → float¶ Returns the estimated width for the whole symbol, which is the maximum width of all marker symbol layers in the symbol.
Warning
This returned value is inaccurate if the symbol consists of multiple symbol layers with different width units. Use the overload accepting a
QgsRenderContext
argument instead for accurate sizes in this case.See also
width(self, context:
QgsRenderContext
) -> float Returns the symbol width, in painter units. This is the maximum width of all marker symbol layers in the symbol.This method returns an accurate width by calculating the actual rendered width of each symbol layer using the provided render
context
.See also
New in version 3.4.5.
- Return type
float