Class: QgsGeometryPaintDevice¶
A paint device which converts everything renderer to a
QgsGeometry representation of the rendered shapes.
Added in version 3.38.
Class Hierarchy¶
Base classes¶
Methods
Returns the rendered geometry. |
|
Sets a simplification tolerance (in painter units) to use for on-the-fly simplification of geometries while rendering. |
|
Sets the number of segments to use when drawing stroked paths with a rounded pen. |
Static Methods
Converts a painter path to a |
- class qgis.core.QgsGeometryPaintDevice[source]¶
Bases:
QPaintDevice- __init__(usePathStroker: bool = False)
Constructor for QgsGeometryPaintDevice.
If
usePathStrokerisTrue, rendered paths will be converted using a stroke respecting the QPainter pen configuration.- Parameters:
usePathStroker (bool = False)
- geometry(self) QgsAbstractGeometry¶
Returns the rendered geometry.
- Return type:
- static painterPathToGeometry(path: QPainterPath) QgsGeometry[source]¶
Converts a painter
pathto aQgsGeometry.Added in version 3.38.1.
- Parameters:
path (QPainterPath)
- Return type:
- setSimplificationTolerance(self, tolerance: float)[source]¶
Sets a simplification tolerance (in painter units) to use for on-the-fly simplification of geometries while rendering.
This will result in simpler, generalised paths.
Set
toleranceto 0 to disable simplification. (No simplification is the default behavior).- Parameters:
tolerance (float)