Class: QgsCurvedLineCallout

class qgis.core.QgsCurvedLineCallout

Bases: QgsSimpleLineCallout

Draws curved lines as callouts.

Added in version 3.20:

Methods

calloutLabelPoint

Returns the anchor point geometry for a label with the given bounding box and anchor point mode.

calloutLineToPart

Calculates the direct line from a label geometry to an anchor geometry part, respecting the various callout settings which influence how the callout end should be placed in the anchor geometry.

clone

rtype:

Optional[QgsCurvedLineCallout]

create

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

createCalloutLine

param start:

curvature

Returns the callout line's curvature.

draw

labelAnchorGeometry

Returns the anchor point geometry for a label with the given bounding box and anchor point mode.

orientation

Returns the callout line's curve orientation.

properties

param context:

setCurvature

Sets the callout line's curvature.

setOrientation

Sets the callout line's curve orientation.

type

rtype:

str

Attributes

Automatic

Clockwise

CounterClockwise

Automatic = 0
Clockwise = 1
CounterClockwise = 2
class Orientation

Bases: int

calloutLabelPoint(self, bodyBoundingBox: QRectF, angle: float, anchor: QgsCallout.LabelAnchorPoint, context: QgsRenderContext, calloutContext: QgsCallout.QgsCalloutContext)

Returns the anchor point geometry for a label with the given bounding box and anchor point mode.

The pinned argument will be set to True if the callout label point is pinned (manually placed).

Added in version 3.20.

calloutLineToPart(self, labelGeometry: QgsGeometry, partGeometry: QgsAbstractGeometry | None, context: QgsRenderContext, calloutContext: QgsCallout.QgsCalloutContext)

Calculates the direct line from a label geometry to an anchor geometry part, respecting the various callout settings which influence how the callout end should be placed in the anchor geometry.

Returns a null geometry if the callout line cannot be calculated.

The pinned argument will be set to True if the callout anchor point is pinned (manually placed).

Added in version 3.20.

clone(self) QgsCurvedLineCallout | None
Return type:

Optional[QgsCurvedLineCallout]

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

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

Parameters:
Return type:

Optional[QgsCallout]

createCalloutLine(self, start: QgsPoint, end: QgsPoint, context: QgsRenderContext, bodyBoundingBox: QRectF, angle: float, anchor: QgsGeometry, calloutContext: QgsCallout.QgsCalloutContext) QgsCurve | None
Parameters:
Return type:

Optional[QgsCurve]

curvature(self) float

Returns the callout line’s curvature.

The curvature is a percentage value (with typical ranges between 0.0 and 1.0), representing the overall curvature of the line.

See also

setCurvature()

Return type:

float

draw(self, context: QgsRenderContext, bodyBoundingBox: QRectF, angle: float, anchor: QgsGeometry, calloutContext: QgsCallout.QgsCalloutContext)
labelAnchorGeometry(self, bodyBoundingBox: QRectF, angle: float, anchor: QgsCallout.LabelAnchorPoint) QgsGeometry

Returns the anchor point geometry for a label with the given bounding box and anchor point mode.

Deprecated since version QGIS: 3.20 use calloutLabelPoint() instead

orientation(self) QgsCurvedLineCallout.Orientation

Returns the callout line’s curve orientation.

See also

setOrientation()

Return type:

QgsCurvedLineCallout.Orientation

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

context (QgsReadWriteContext)

Return type:

Dict[str, Any]

setCurvature(self, curvature: float)

Sets the callout line’s curvature.

The curvature is a percentage value (with typical ranges between 0.0 and 1.0), representing the overall curvature of the line.

See also

curvature()

Parameters:

curvature (float)

setOrientation(self, orientation: QgsCurvedLineCallout.Orientation)

Sets the callout line’s curve orientation.

See also

orientation()

Parameters:

orientation (QgsCurvedLineCallout.Orientation)

type(self) str
Return type:

str