Class: QgsNullSymbolRenderer

class qgis.core.QgsNullSymbolRenderer

Bases: QgsFeatureRenderer

Null symbol renderer. Renderer which draws no symbols for features by default, but allows for labeling and diagrams for the layer. Selected features will also be drawn with a default symbol.

Methods

clone

rtype

QgsFeatureRenderer

convertFromRenderer

Creates a QgsNullSymbolRenderer from an existing renderer.

convertSymbolRotation

convertSymbolSizeScale

copyRendererData

Clones generic renderer data to another renderer.

create

Creates a null renderer from XML element.

dump

rtype

str

originalSymbolForFeature

param feature

renderFeature

param feature

renderFeatureWithSymbol

Render the feature with the symbol using context.

renderVertexMarker

render editing vertex marker at specified point

renderVertexMarkerPolygon

render editing vertex marker for a polygon

renderVertexMarkerPolyline

render editing vertex marker for a polyline

save

param doc

stopRender

param context

symbolForFeature

param feature

symbols

param context

usedAttributes

param context

willRenderFeature

param feature

clone(self)QgsFeatureRenderer
Return type

QgsFeatureRenderer

convertFromRenderer(renderer: QgsFeatureRenderer)QgsNullSymbolRenderer

Creates a QgsNullSymbolRenderer from an existing renderer.

Parameters

renderer (QgsFeatureRenderer) – renderer to convert from

Return type

QgsNullSymbolRenderer

Returns

a new renderer if the conversion was possible, otherwise None.

convertSymbolRotation(symbol: QgsSymbol, field: str)

Note

this function is used to convert old rotations expressions to symbol level DataDefined angle

convertSymbolSizeScale(symbol: QgsSymbol, method: Qgis.ScaleMethod, field: str)

Note

this function is used to convert old sizeScale expressions to symbol level DataDefined size

copyRendererData(self, destRenderer: QgsFeatureRenderer)

Clones generic renderer data to another renderer. Currently clones

  • Order By

  • Paint Effect

Parameters

destRenderer – destination renderer for copied effect

create(element: QDomElement, context: QgsReadWriteContext)QgsFeatureRenderer

Creates a null renderer from XML element.

Parameters
Return type

QgsFeatureRenderer

Returns

new null symbol renderer

dump(self)str
Return type

str

originalSymbolForFeature(self, feature: QgsFeature, context: QgsRenderContext)QgsSymbol
Parameters
Return type

QgsSymbol

renderFeature(self, feature: QgsFeature, context: QgsRenderContext, layer: int = - 1, selected: bool = False, drawVertexMarker: bool = False)bool
Parameters
  • feature (QgsFeature) –

  • context (QgsRenderContext) –

  • layer (int = -1) –

  • selected (bool = False) –

  • drawVertexMarker (bool = False) –

Return type

bool

renderFeatureWithSymbol(self, feature: QgsFeature, symbol: QgsSymbol, context: QgsRenderContext, layer: int, selected: bool, drawVertexMarker: bool)

Render the feature with the symbol using context. Use layer to specify the symbol layer, selected to specify if it should be rendered as selected and drawVertexMarker to specify if vertex markers should be rendered.

renderVertexMarker(self, pt: Union[QPointF, QPoint], context: QgsRenderContext)

render editing vertex marker at specified point

renderVertexMarkerPolygon(self, pts: QPolygonF, rings: Iterable[QPolygonF], context: QgsRenderContext)

render editing vertex marker for a polygon

renderVertexMarkerPolyline(self, pts: QPolygonF, context: QgsRenderContext)

render editing vertex marker for a polyline

save(self, doc: QDomDocument, context: QgsReadWriteContext)QDomElement
Parameters
Return type

QDomElement

stopRender(self, context: QgsRenderContext)
Parameters

context (QgsRenderContext) –

symbolForFeature(self, feature: QgsFeature, context: QgsRenderContext)QgsSymbol
Parameters
Return type

QgsSymbol

symbols(self, context: QgsRenderContext)List[QgsSymbol]
Parameters

context (QgsRenderContext) –

Return type

List[QgsSymbol]

usedAttributes(self, context: QgsRenderContext)Set[str]
Parameters

context (QgsRenderContext) –

Return type

Set[str]

willRenderFeature(self, feature: QgsFeature, context: QgsRenderContext)bool
Parameters
Return type

bool