Class: QgsFillSymbolLayer

Abstract base class for fill symbol layers.

Note

This is an abstract class, with methods which must be implemented by a subclass.

The following methods must be implemented: QgsSymbolLayer.clone(), QgsSymbolLayer.layerType(), QgsSymbolLayer.properties(), renderPolygon(), QgsSymbolLayer.startRender(), QgsSymbolLayer.stopRender()

Class Hierarchy

Inheritance diagram of qgis.core.QgsFillSymbolLayer

Base classes

QgsSymbolLayer

Abstract base class for symbol layers.

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 fill symbol layers which fill polygons with a repeated image.

QgsRandomMarkerFillSymbolLayer

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

QgsShapeburstFillSymbolLayer

A fill symbol layer which applies a gradient from the outer edges of a symbol to the inside.

QgsSimpleFillSymbolLayer

Renders polygons using a single fill and stroke color.

Abstract Methods

renderPolygon

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

Methods

angle

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

setAngle

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

Virtual Methods

In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsFillSymbolLayer. See the FAQ for more details.

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

abstract 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)

virtual 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.