Class: QgsFillSymbol¶
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
Class Hierarchy¶
Base classes¶
Abstract base class for all rendered symbols. |
Methods
Renders the symbol using the given render context. |
|
Static Methods
Create a fill symbol with one symbol layer: SimpleFill with specified properties. |
- class qgis.core.QgsFillSymbol[source]¶
Bases:
QgsSymbol
- __init__(layers: Iterable[QgsSymbolLayer] = [])
Constructor for QgsFillSymbol, with the specified list of initial symbol
layers
.Ownership of the
layers
are transferred to the symbol.- Parameters:
layers (Iterable[QgsSymbolLayer] = [])
- static createSimple(properties: Dict[str, Any]) QgsFillSymbol | None ¶
Create a fill symbol with one symbol layer: SimpleFill with specified properties. This is a convenience method for easier creation of fill symbols.
- Parameters:
properties (Dict[str, Any])
- Return type:
Optional[QgsFillSymbol]
- renderPolygon(self, points: QPolygonF, rings: Iterable[QPolygonF] | None, f: QgsFeature | None, context: QgsRenderContext, layer: int = -1, selected: bool = False)[source]¶
Renders the symbol using the given render
context
.The
points
list dictates the exterior ring for the polygon to render, and interior rings are optionally specified via therings
argument.The
f
argument is used to pass the feature currently being rendered (when available).If only a single symbol layer from the symbol should be rendered, it should be specified in the
layer
argument. Alayer
of -1 indicates that all symbol layers should be rendered.If
selected
isTrue
then the symbol will be drawn using the “selected feature” style and colors instead of the symbol’s normal style.- Parameters:
points (QPolygonF)
rings (Optional[Iterable[QPolygonF]])
f (Optional[QgsFeature])
context (QgsRenderContext)
layer (int = -1)
selected (bool = False)