Class: QgsSimpleMarkerSymbolLayer¶
Simple marker symbol layer, consisting of a rendered shape with solid fill color and an stroke.
Class Hierarchy¶
Base classes¶
Abstract base class for simple marker symbol layers. Handles creation of the symbol shapes but leaves the actual drawing of the symbols to subclasses. |
|
Abstract base class for marker symbol layers. |
|
Constructor for QgsSymbolLayer. |
Methods
Draws the marker shape in the specified painter. |
|
Returns the marker's stroke cap style (e.g., flat, round, etc). |
|
Returns the marker's stroke join style (e.g., miter, bevel, etc). |
|
Prepares cache image |
|
Sets the marker's stroke cap style (e.g., flat, round, etc). |
|
Sets the marker's stroke join style (e.g., miter, bevel, etc). |
|
Sets the marker's stroke color. |
|
Sets the marker's stroke style (e.g., solid, dashed, etc) |
|
Sets the width of the marker's stroke. |
|
Sets the map scale for the width of the marker's stroke. |
|
Sets the unit for the width of the marker's stroke. |
|
Returns the marker's stroke color. |
|
Returns the marker's stroke style (e.g., solid, dashed, etc) |
|
Returns the width of the marker's stroke. |
|
Returns the map scale for the width of the marker's stroke. |
|
Returns the unit for the width of the marker's stroke. |
Static Methods
Creates a new QgsSimpleMarkerSymbolLayer. |
|
Creates a new |
- class qgis.core.QgsSimpleMarkerSymbolLayer[source]¶
Bases:
QgsSimpleMarkerSymbolLayerBase
- __init__(shape: Qgis.MarkerShape = Qgis.MarkerShape.Circle, size: float = DEFAULT_SIMPLEMARKER_SIZE, angle: float = DEFAULT_SIMPLEMARKER_ANGLE, scaleMethod: Qgis.ScaleMethod = DEFAULT_SCALE_METHOD, color: QColor | Qt.GlobalColor = DEFAULT_SIMPLEMARKER_COLOR, strokeColor: QColor | Qt.GlobalColor = DEFAULT_SIMPLEMARKER_BORDERCOLOR, penJoinStyle: Qt.PenJoinStyle = DEFAULT_SIMPLEMARKER_JOINSTYLE)
Constructor for QgsSimpleMarkerSymbolLayer.
- Parameters:
shape (Qgis.MarkerShape = Qgis.MarkerShape.Circle) – symbol shape
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
color (Union[QColor, Qt.GlobalColor] = DEFAULT_SIMPLEMARKER_COLOR) – fill color for symbol
strokeColor (Union[QColor, Qt.GlobalColor] = DEFAULT_SIMPLEMARKER_BORDERCOLOR) – stroke color for symbol
penJoinStyle (Qt.PenJoinStyle = DEFAULT_SIMPLEMARKER_JOINSTYLE) – join style for stroke pen
- calculateOffsetAndRotation()¶
- calculateSize()¶
- static create(properties: Dict[str, Any] = {}) QgsSymbolLayer | None [source]¶
Creates a new QgsSimpleMarkerSymbolLayer.
- Parameters:
properties (Dict[str, Any] = {}) – a property map containing symbol properties (see
properties()
)- Return type:
Optional[QgsSymbolLayer]
- Returns:
new QgsSimpleMarkerSymbolLayer
- static createFromSld(element: QDomElement) QgsSymbolLayer | None [source]¶
Creates a new
QgsSimpleMarkerSymbolLayer
from an SLD XML element.- Parameters:
element (QDomElement) – XML element containing SLD definition of symbol
- Return type:
Optional[QgsSymbolLayer]
- Returns:
new QgsSimpleMarkerSymbolLayer
- drawMarker(self, p: QPainter | None, context: QgsSymbolRenderContext)[source]¶
Draws the marker shape in the specified painter.
- Parameters:
p (Optional[QPainter]) – destination QPainter
context (QgsSymbolRenderContext) – symbol context
Note
this method does not handle setting the painter pen or brush to match the symbol’s fill or stroke
- penCapStyle(self) Qt.PenCapStyle [source]¶
Returns the marker’s stroke cap style (e.g., flat, round, etc).
See also
See also
See also
See also
Added in version 3.20.
- Return type:
Qt.PenCapStyle
- penJoinStyle(self) Qt.PenJoinStyle [source]¶
Returns the marker’s stroke join style (e.g., miter, bevel, etc).
See also
See also
See also
See also
- Return type:
Qt.PenJoinStyle
- prepareCache(self, context: QgsSymbolRenderContext) bool [source]¶
Prepares cache image
- Return type:
bool
- Returns:
True
in case of success,False
if cache image size too large- Parameters:
context (QgsSymbolRenderContext)
- prepareMarkerPath()¶
- prepareMarkerShape()¶
- setPenCapStyle(self, style: Qt.PenCapStyle)[source]¶
Sets the marker’s stroke cap
style
(e.g., flat, round, etc).See also
See also
See also
See also
Added in version 3.20.
- Parameters:
style (Qt.PenCapStyle)
- setPenJoinStyle(self, style: Qt.PenJoinStyle)[source]¶
Sets the marker’s stroke join style (e.g., miter, bevel, etc).
- Parameters:
style (Qt.PenJoinStyle) – join style
See also
See also
See also
See also
- setStrokeColor(self, color: QColor | Qt.GlobalColor)[source]¶
Sets the marker’s stroke color.
- Parameters:
color (Union[QColor, Qt.GlobalColor]) – stroke color
See also
See also
See also
- setStrokeStyle(self, strokeStyle: Qt.PenStyle)[source]¶
Sets the marker’s stroke style (e.g., solid, dashed, etc)
- Parameters:
strokeStyle (Qt.PenStyle) – style
See also
See also
See also
- setStrokeWidth(self, w: float)[source]¶
Sets the width of the marker’s stroke.
- Parameters:
w (float) – stroke width. See
strokeWidthUnit()
for units.
See also
See also
See also
- setStrokeWidthMapUnitScale(self, scale: QgsMapUnitScale)[source]¶
Sets the map scale for the width of the marker’s stroke.
- Parameters:
scale (QgsMapUnitScale) – stroke width map unit scale
See also
See also
See also
- setStrokeWidthUnit(self, u: Qgis.RenderUnit)[source]¶
Sets the unit for the width of the marker’s stroke.
- Parameters:
u (Qgis.RenderUnit) – stroke width unit
See also
See also
See also
- shapeToPolygon()¶
- strokeColor(self) QColor [source]¶
Returns the marker’s stroke color.
See also
See also
See also
- Return type:
QColor
- strokeStyle(self) Qt.PenStyle [source]¶
Returns the marker’s stroke style (e.g., solid, dashed, etc)
See also
See also
See also
- Return type:
Qt.PenStyle
- strokeWidth(self) float [source]¶
Returns the width of the marker’s stroke.
See also
See also
See also
- Return type:
float
- strokeWidthMapUnitScale(self) QgsMapUnitScale ¶
Returns the map scale for the width of the marker’s stroke.
See also
See also
See also
- Return type:
- strokeWidthUnit(self) Qgis.RenderUnit [source]¶
Returns the unit for the width of the marker’s stroke.
See also
See also
See also
- Return type: