Class: QgsSimpleMarkerSymbolLayerBase

Abstract base class for simple marker symbol layers.

Handles creation of the symbol shapes but leaves the actual drawing of the symbols to subclasses.

Note

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

The following methods must be implemented: QgsSymbolLayer.clone(), draw(), QgsSymbolLayer.layerType(), QgsSymbolLayer.properties()

Class Hierarchy

Inheritance diagram of qgis.core.QgsSimpleMarkerSymbolLayerBase

Base classes

QgsMarkerSymbolLayer

Abstract base class for marker symbol layers.

QgsSymbolLayer

Abstract base class for symbol layers.

Subclasses

QgsFilledMarkerSymbolLayer

Filled marker symbol layer, consisting of a shape which is rendered using a QgsFillSymbol. This allows the symbol to support advanced styling of the interior and stroke of the shape.

QgsSimpleMarkerSymbolLayer

Simple marker symbol layer, consisting of a rendered shape with solid fill color and a stroke.

Enums

Shape

alias of MarkerShape

Methods

setShape

Sets the rendered marker shape.

shape

Returns the shape for the rendered marker symbol.

Static Methods

availableShapes

Returns a list of all available shape types.

decodeShape

Attempts to decode a string representation of a shape name to the corresponding shape.

encodeShape

Encodes a shape to its string representation.

shapeIsFilled

Returns True if a symbol shape has a fill.

class qgis.core.QgsSimpleMarkerSymbolLayerBase[source]

Bases: QgsMarkerSymbolLayer

__init__(shape: Qgis.MarkerShape = Qgis.MarkerShape.Circle, size: float = DEFAULT_SIMPLEMARKER_SIZE, angle: float = DEFAULT_SIMPLEMARKER_ANGLE, scaleMethod: Qgis.ScaleMethod = DEFAULT_SCALE_METHOD)

Constructor for QgsSimpleMarkerSymbolLayerBase.

Parameters:
  • shape (Qgis.MarkerShape = Qgis.MarkerShape.Circle) – symbol shape for markers

  • size (float = DEFAULT_SIMPLEMARKER_SIZE) – symbol size (in mm)

  • angle (float = DEFAULT_SIMPLEMARKER_ANGLE) – symbol rotation angle

  • scaleMethod (Qgis.ScaleMethod = DEFAULT_SCALE_METHOD) – scaling method for data defined scaling

Shape

alias of MarkerShape

static availableShapes() List[Qgis.MarkerShape]

Returns a list of all available shape types.

Return type:

List[Qgis.MarkerShape]

static decodeShape(name: str | None)[source]

Attempts to decode a string representation of a shape name to the corresponding shape.

Parameters:
  • name (Optional[str]) -> (Qgis.MarkerShape) – encoded shape name

  • ok – if specified, will be set to True if shape was successfully decoded

Returns:

decoded name

See also

encodeShape()

static encodeShape(shape: Qgis.MarkerShape) str[source]

Encodes a shape to its string representation.

Parameters:

shape (Qgis.MarkerShape) – shape to encode

Return type:

str

Returns:

encoded string

See also

decodeShape()

setShape(self, shape: Qgis.MarkerShape)[source]

Sets the rendered marker shape.

Parameters:

shape (Qgis.MarkerShape) – new marker shape

See also

shape()

shape(self) Qgis.MarkerShape[source]

Returns the shape for the rendered marker symbol.

See also

setShape()

Return type:

Qgis.MarkerShape

static shapeIsFilled(shape: Qgis.MarkerShape) bool[source]

Returns True if a symbol shape has a fill.

Parameters:

shape (Qgis.MarkerShape) – shape to test

Return type:

bool

Returns:

True if shape uses a fill, or False if shape uses lines only