Class: QgsFillSymbol¶
- class qgis.core.QgsFillSymbol(layers: Iterable[QgsSymbolLayer] = [])¶
Bases:
QgsSymbol
Constructor for
QgsFillSymbol
, with the specified list of initial symbollayers
.Ownership of the
layers
are transferred to the symbol.A fill symbol type, for rendering Polygon and MultiPolygon geometries.
Methods
- rtype
QgsFillSymbol
Retrieve a cloned list of all layers that make up this symbol.
Create a fill symbol with one symbol layer: SimpleFill with specified properties.
Renders the symbol using the given render
context
.Renders a context using a particular symbol layer without passing in a geometry.
Render editing vertex marker at specified point
- param angle
- clone(self) → QgsFillSymbol¶
- Return type
- cloneLayers(self) → List[QgsSymbolLayer]¶
Retrieve a cloned list of all layers that make up this symbol. Ownership is transferred to the caller.
- createSimple(properties: Dict[str, Any]) → QgsFillSymbol¶
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) –
- Return type
- renderPolygon(self, points: QPolygonF, rings: Iterable[QPolygonF], f: QgsFeature, context: QgsRenderContext, layer: int = - 1, selected: bool = False)¶
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 (Iterable[QPolygonF]) –
f (QgsFeature) –
context (QgsRenderContext) –
layer (int = -1) –
selected (bool = False) –
- renderUsingLayer(self, layer: QgsSymbolLayer, context: QgsSymbolRenderContext)¶
Renders a context using a particular symbol layer without passing in a geometry. This is used as fallback, if the symbol being rendered is not compatible with the specified layer. In such a case, this method can be called and will call the layer’s rendering method anyway but the geometry passed to the layer will be empty. This is required for layers that generate their own geometry from other information in the rendering context.
- renderVertexMarker(self, pt: Union[QPointF, QPoint], context: QgsRenderContext, currentVertexMarkerType: int, currentVertexMarkerSize: float)¶
Render editing vertex marker at specified point
New in version 2.16.
- setAngle(self, angle: float)¶
- Parameters
angle (float) –