Class: QgsSimpleLineCallout

class qgis.core.QgsSimpleLineCallout

Bases: QgsCallout

A simple direct line callout style.

Methods

clone

rtype

QgsSimpleLineCallout

create

Creates a new QgsSimpleLineCallout, using the settings serialized in the properties map (corresponding to the output from QgsSimpleLineCallout.properties() ).

draw

param context

drawCalloutToAllParts

Returns True if callout lines should be drawn to all feature parts.

lineSymbol

Returns the line symbol used to render the callout line.

minimumLength

Returns the minimum length of callout lines.

minimumLengthMapUnitScale

Returns the map unit scale for the minimum callout length.

minimumLengthUnit

Returns the units for the minimum length of callout lines.

offsetFromAnchor

Returns the offset distance from the anchor point at which to start the line.

offsetFromAnchorMapUnitScale

Returns the map unit scale for the offset from anchor.

offsetFromAnchorUnit

Returns the units for the offset from anchor point.

offsetFromLabel

Returns the offset distance from label area at which to end the line.

offsetFromLabelMapUnitScale

Returns the map unit scale for the minimum callout length.

offsetFromLabelUnit

Returns the units for the offset from label area.

properties

param context

readProperties

param props

referencedFields

param context

setDrawCalloutToAllParts

Sets whether callout lines should be drawn to all feature parts.

setLineSymbol

Sets the line symbol used to render the callout line.

setMinimumLength

Sets the minimum length of callout lines.

setMinimumLengthMapUnitScale

Sets the map unit scale for the minimum callout length.

setMinimumLengthUnit

Sets the unit for the minimum length of callout lines.

setOffsetFromAnchor

Sets the offset distance from the anchor point at which to start the line.

setOffsetFromAnchorMapUnitScale

Sets the map unit scale for the offset from anchor.

setOffsetFromAnchorUnit

Sets the unit for the offset from anchor distance.

setOffsetFromLabel

Sets the offset distance from label area at which to end the line.

setOffsetFromLabelMapUnitScale

Sets the map unit scale for the offset from label area.

setOffsetFromLabelUnit

Sets the unit for the offset from label area distance.

startRender

param context

stopRender

param context

type

rtype

str

clone(self)QgsSimpleLineCallout
Return type

QgsSimpleLineCallout

create(properties: Dict[str, Any] = {}, context: QgsReadWriteContext = QgsReadWriteContext())QgsCallout

Creates a new QgsSimpleLineCallout, using the settings serialized in the properties map (corresponding to the output from QgsSimpleLineCallout.properties() ).

Parameters
Return type

QgsCallout

draw(self, context: QgsRenderContext, bodyBoundingBox: QRectF, angle: float, anchor: QgsGeometry, calloutContext: QgsCallout.QgsCalloutContext)
Parameters
drawCalloutToAllParts(self) → bool

Returns True if callout lines should be drawn to all feature parts.

Return type

bool

lineSymbol(self)QgsLineSymbol

Returns the line symbol used to render the callout line.

Ownership is not transferred.

See also

setLineSymbol()

Return type

QgsLineSymbol

minimumLength(self) → float

Returns the minimum length of callout lines. Units are specified through minimumLengthUnits().

Return type

float

minimumLengthMapUnitScale(self)QgsMapUnitScale

Returns the map unit scale for the minimum callout length.

See also

minimumLength()

Return type

QgsMapUnitScale

minimumLengthUnit(self) → QgsUnitTypes.RenderUnit

Returns the units for the minimum length of callout lines.

See also

minimumLength()

Return type

QgsUnitTypes.RenderUnit

offsetFromAnchor(self) → float

Returns the offset distance from the anchor point at which to start the line. Units are specified through offsetFromAnchorUnit().

Return type

float

offsetFromAnchorMapUnitScale(self)QgsMapUnitScale

Returns the map unit scale for the offset from anchor.

Return type

QgsMapUnitScale

offsetFromAnchorUnit(self) → QgsUnitTypes.RenderUnit

Returns the units for the offset from anchor point.

Return type

QgsUnitTypes.RenderUnit

offsetFromLabel(self) → float

Returns the offset distance from label area at which to end the line. Units are specified through offsetFromLabelUnit().

Return type

float

offsetFromLabelMapUnitScale(self)QgsMapUnitScale

Returns the map unit scale for the minimum callout length.

Return type

QgsMapUnitScale

offsetFromLabelUnit(self) → QgsUnitTypes.RenderUnit

Returns the units for the offset from label area.

Return type

QgsUnitTypes.RenderUnit

properties(self, context: QgsReadWriteContext) → Dict[str, Any]
Parameters

context (QgsReadWriteContext) –

Return type

Dict[str, Any]

readProperties(self, props: Dict[str, Any], context: QgsReadWriteContext)
Parameters
referencedFields(self, context: QgsRenderContext) → Set[str]
Parameters

context (QgsRenderContext) –

Return type

Set[str]

setDrawCalloutToAllParts(self, drawToAllParts: bool)

Sets whether callout lines should be drawn to all feature parts.

Parameters

drawToAllParts (bool) –

setLineSymbol(self, symbol: QgsLineSymbol)

Sets the line symbol used to render the callout line. Ownership of symbol is transferred to the callout.

See also

lineSymbol()

Parameters

symbol (QgsLineSymbol) –

setMinimumLength(self, length: float)

Sets the minimum length of callout lines. Units are specified through setMinimumLengthUnit().

See also

minimumLength()

Parameters

length (float) –

setMinimumLengthMapUnitScale(self, scale: QgsMapUnitScale)

Sets the map unit scale for the minimum callout length.

Parameters

scale (QgsMapUnitScale) –

setMinimumLengthUnit(self, unit: QgsUnitTypes.RenderUnit)

Sets the unit for the minimum length of callout lines.

Parameters

unit (QgsUnitTypes.RenderUnit) –

setOffsetFromAnchor(self, distance: float)

Sets the offset distance from the anchor point at which to start the line. Units are specified through setOffsetFromAnchorUnit().

Parameters

distance (float) –

setOffsetFromAnchorMapUnitScale(self, scale: QgsMapUnitScale)

Sets the map unit scale for the offset from anchor.

Parameters

scale (QgsMapUnitScale) –

setOffsetFromAnchorUnit(self, unit: QgsUnitTypes.RenderUnit)

Sets the unit for the offset from anchor distance.

Parameters

unit (QgsUnitTypes.RenderUnit) –

setOffsetFromLabel(self, distance: float)

Sets the offset distance from label area at which to end the line. Units are specified through setOffsetFromLabelUnit().

Parameters

distance (float) –

setOffsetFromLabelMapUnitScale(self, scale: QgsMapUnitScale)

Sets the map unit scale for the offset from label area.

Parameters

scale (QgsMapUnitScale) –

setOffsetFromLabelUnit(self, unit: QgsUnitTypes.RenderUnit)

Sets the unit for the offset from label area distance.

Parameters

unit (QgsUnitTypes.RenderUnit) –

startRender(self, context: QgsRenderContext)
Parameters

context (QgsRenderContext) –

stopRender(self, context: QgsRenderContext)
Parameters

context (QgsRenderContext) –

type(self) → str
Return type

str