Class: QgsSVGFillSymbolLayer¶
A fill symbol layer which fills polygons with a repeated SVG file.
Class Hierarchy¶
Base classes¶
Base class for fill symbol layers which fill polygons with a repeated image. |
|
Abstract base class for fill symbol layers. |
|
Abstract base class for symbol layers. |
Methods
Returns the dynamic SVG parameters |
|
Returns the width of the rendered SVG content within the fill (i.e. the pattern repeat/tile size). |
|
Returns the map unit scale for the pattern's width. |
|
Returns the units for the width of the SVG images in the pattern. |
|
Sets the dynamic SVG parameters |
|
Sets the width to render the SVG content as within the fill (i.e. the pattern repeat/tile size). |
|
Sets the map unit scale for the pattern's width. |
|
Sets the unit for the width of the SVG images in the pattern. |
|
Sets the path to the SVG file to render in the fill. |
|
Sets the fill color used for rendering the SVG content. |
|
Sets the stroke color used for rendering the SVG content. |
|
Sets the stroke width used for rendering the SVG content. |
|
Sets the map unit scale for the pattern's stroke. |
|
Sets the unit for the stroke width. |
|
Returns the path to the SVG file used to render the fill. |
|
Returns the fill color used for rendering the SVG content. |
|
Returns the stroke color used for rendering the SVG content. |
|
Returns the stroke width used for rendering the SVG content. |
|
Returns the map unit scale for the pattern's stroke. |
|
Returns the units for the stroke width. |
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsSVGFillSymbolLayer. See the FAQ for more details.
Static Methods
Creates a new |
|
Creates a new |
|
Turns relative paths in properties map to absolute when reading and vice versa when writing. |
- class qgis.core.QgsSVGFillSymbolLayer[source]¶
Bases:
QgsImageFillSymbolLayer
- __init__(svgFilePath: str | None, width: float = 20, rotation: float = 0)
Constructor for QgsSVGFillSymbolLayer, using the SVG picture at the specified absolute file path.
- Parameters:
svgFilePath (Optional[str])
width (float = 20)
rotation (float = 0)
- __init__(svgData: QByteArray | bytes | bytearray, width: float = 20, rotation: float = 0)
Constructor for QgsSVGFillSymbolLayer, using the specified SVG picture data.
- Parameters:
svgData (Union[QByteArray, bytes, bytearray])
width (float = 20)
rotation (float = 0)
- virtual applyBrushTransformFromContext()¶
- virtual applyDataDefinedSettings(self, context: QgsSymbolRenderContext)[source]¶
- Parameters:
context (QgsSymbolRenderContext)
- static create(properties: Dict[str, Any] = {}) QgsSymbolLayer | None [source]¶
Creates a new
QgsSVGFillSymbolLayer
from aproperties
map. The caller takes ownership of the returned object.- Parameters:
properties (Dict[str, Any] = {})
- Return type:
Optional[QgsSymbolLayer]
- static createFromSld(element: QDomElement) QgsSymbolLayer | None [source]¶
Creates a new
QgsSVGFillSymbolLayer
from a SLDelement
. The caller takes ownership of the returned object.- Parameters:
element (QDomElement)
- Return type:
Optional[QgsSymbolLayer]
- parameters(self) Dict[str, QgsProperty] ¶
Returns the dynamic SVG parameters
Added in version 3.18.
- Return type:
Dict[str, QgsProperty]
- patternWidth(self) float [source]¶
Returns the width of the rendered SVG content within the fill (i.e. the pattern repeat/tile size).
Units are retrieved by
patternWidthUnit()
See also
See also
See also
- Return type:
float
- patternWidthMapUnitScale(self) QgsMapUnitScale ¶
Returns the map unit scale for the pattern’s width.
See also
See also
See also
- Return type:
- patternWidthUnit(self) Qgis.RenderUnit [source]¶
Returns the units for the width of the SVG images in the pattern.
See also
See also
See also
- Return type:
- static resolvePaths(properties: Dict[str, Any], pathResolver: QgsPathResolver, saving: bool)[source]¶
Turns relative paths in properties map to absolute when reading and vice versa when writing. Used internally when reading/writing symbols.
- Parameters:
properties (Dict[str, Any])
pathResolver (QgsPathResolver)
saving (bool)
- setParameters(self, parameters: Dict[str | None, QgsProperty])[source]¶
Sets the dynamic SVG parameters
Added in version 3.18.
- Parameters:
parameters (Dict[Optional[str], QgsProperty])
- setPatternWidth(self, width: float)[source]¶
Sets the
width
to render the SVG content as within the fill (i.e. the pattern repeat/tile size).Units are specified by
setPatternWidthUnit()
See also
See also
See also
- Parameters:
width (float)
- setPatternWidthMapUnitScale(self, scale: QgsMapUnitScale)[source]¶
Sets the map unit
scale
for the pattern’s width.See also
See also
See also
- Parameters:
scale (QgsMapUnitScale)
- setPatternWidthUnit(self, unit: Qgis.RenderUnit)[source]¶
Sets the
unit
for the width of the SVG images in the pattern.See also
See also
See also
- Parameters:
unit (Qgis.RenderUnit)
- setSvgFilePath(self, svgPath: str | None)[source]¶
Sets the path to the SVG file to render in the fill.
This is usually an absolute file path. Other supported options include
relative paths to folders from the user’s SVG search paths
base64 encoded content, prefixed with a ‘base64:’ string
http(s) paths
See also
- Parameters:
svgPath (Optional[str])
- setSvgFillColor(self, c: QColor | Qt.GlobalColor)[source]¶
Sets the fill color used for rendering the SVG content.
Fill color is only supported for parametrized SVG files. Color opacity is ignored if the SVG file does not support parametrized fill opacity.
See also
See also
- Parameters:
c (Union[QColor, Qt.GlobalColor])
- setSvgStrokeColor(self, c: QColor | Qt.GlobalColor)[source]¶
Sets the stroke color used for rendering the SVG content.
Stroke color is only supported for parametrized SVG files. Color opacity is ignored if the SVG file does not support parametrized outline opacity.
See also
See also
- Parameters:
c (Union[QColor, Qt.GlobalColor])
- setSvgStrokeWidth(self, w: float)[source]¶
Sets the stroke width used for rendering the SVG content.
Stroke width is only supported for parametrized SVG files. Units are specified via
setSvgStrokeWidthUnit()
See also
See also
See also
- Parameters:
w (float)
- setSvgStrokeWidthMapUnitScale(self, scale: QgsMapUnitScale)[source]¶
Sets the map unit
scale
for the pattern’s stroke.See also
See also
See also
- Parameters:
scale (QgsMapUnitScale)
- setSvgStrokeWidthUnit(self, unit: Qgis.RenderUnit)[source]¶
Sets the
unit
for the stroke width.See also
See also
See also
- Parameters:
unit (Qgis.RenderUnit)
- svgFilePath(self) str [source]¶
Returns the path to the SVG file used to render the fill.
See also
- Return type:
str
- svgFillColor(self) QColor [source]¶
Returns the fill color used for rendering the SVG content.
Fill color is only supported for parametrized SVG files.
See also
See also
- Return type:
QColor
- svgStrokeColor(self) QColor [source]¶
Returns the stroke color used for rendering the SVG content.
Stroke color is only supported for parametrized SVG files.
See also
See also
- Return type:
QColor
- svgStrokeWidth(self) float [source]¶
Returns the stroke width used for rendering the SVG content.
Stroke width is only supported for parametrized SVG files. Units are retrieved via
setSvgStrokeWidthUnit()
See also
See also
See also
- Return type:
float
- svgStrokeWidthMapUnitScale(self) QgsMapUnitScale ¶
Returns the map unit scale for the pattern’s stroke.
See also
See also
See also
- Return type:
- svgStrokeWidthUnit(self) Qgis.RenderUnit [source]¶
Returns the units for the stroke width.
See also
See also
See also
- Return type: