Class: QgsFillSymbolLayer

Abstract base class for fill symbol layers.

Class Hierarchy

Inheritance diagram of qgis.core.QgsFillSymbolLayer

Base classes

QgsSymbolLayer

Constructor for QgsSymbolLayer.

Subclasses

QgsCentroidFillSymbolLayer

A fill symbol layer which renders a marker symbol at the centroid of a polygon geometry.

QgsGradientFillSymbolLayer

A fill symbol layer which draws a smooth color gradient over a polygon.

QgsImageFillSymbolLayer

Base class for polygon renderers generating texture images

QgsRandomMarkerFillSymbolLayer

A fill symbol layer which places markers at random locations within polygons.

QgsShapeburstFillSymbolLayer

Constructor for QgsShapeburstFillSymbolLayer.

QgsSimpleFillSymbolLayer

Renders polygons using a single fill and stroke color.

Methods

angle

Returns the rotation angle of the fill symbol, in degrees clockwise.

renderPolygon

Renders the fill symbol layer for the polygon whose outer ring is defined by points, using the given render context.

setAngle

Sets the rotation angle of the pattern, in degrees clockwise.

toTiledPatternImage

Renders the symbol layer as an image that can be used as a seamless pattern fill for polygons, this method is used by SLD export to generate image tiles for ExternalGraphic polygon fills.

class qgis.core.QgsFillSymbolLayer[source]

Bases: QgsSymbolLayer

angle(self) float[source]

Returns the rotation angle of the fill symbol, in degrees clockwise.

Note

Not all fill symbol layers support rotation.

See also

setAngle()

Return type:

float

renderPolygon(self, points: QPolygonF, rings: Iterable[QPolygonF] | None, context: QgsSymbolRenderContext)[source]

Renders the fill symbol layer for the polygon whose outer ring is defined by points, using the given render context.

The rings argument optionally specifies a list of polygon rings to render as holes.

Parameters:
setAngle(self, angle: float)[source]

Sets the rotation angle of the pattern, in degrees clockwise.

Note

Not all fill symbol layers support rotation.

See also

angle()

Parameters:

angle (float)

toTiledPatternImage(self) QImage[source]

Renders the symbol layer as an image that can be used as a seamless pattern fill for polygons, this method is used by SLD export to generate image tiles for ExternalGraphic polygon fills.

The default implementation returns a null image.

Return type:

QImage

Returns:

the tile image (not necessarily a square) or a null image if not implemented.

Added in version 3.30.