Class: QgsManhattanLineCallout

class qgis.core.QgsManhattanLineCallout

Bases: QgsSimpleLineCallout

Draws straight (right angled) lines as callouts.

New in version 3.10:

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

QgsManhattanLineCallout

create

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

createCalloutLine

param start

draw

labelAnchorGeometry

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

type

rtype

str

calloutLabelPoint(self, bodyBoundingBox: QRectF, angle: float, anchor: QgsCallout.LabelAnchorPoint, context: QgsRenderContext, calloutContext: QgsCallout.QgsCalloutContext) Tuple[QgsGeometry, bool]

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).

New in version 3.20.

calloutLineToPart(self, labelGeometry: QgsGeometry, partGeometry: QgsAbstractGeometry, context: QgsRenderContext, calloutContext: QgsCallout.QgsCalloutContext) Tuple[QgsGeometry, bool]

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).

New in version 3.20.

clone(self) QgsManhattanLineCallout
Return type

QgsManhattanLineCallout

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

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

Parameters
Return type

QgsCallout

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

QgsCurve

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

type(self) str
Return type

str