Class: QgsCalloutPosition

class qgis.core.QgsCalloutPosition

Bases: sip.wrapper

Represents the calculated placement of a map label callout line.

New in version 3.20.

QgsCalloutPosition(id: int, layer: str, providerId: str = ‘’) Constructor for QgsCalloutPosition.

Parameters:
  • id – associated feature ID

  • layer – ID of associated map layer

  • providerId – ID of associated label provider

QgsCalloutPosition() Constructor for QgsCalloutPosition

QgsCalloutPosition(QgsCalloutPosition)

Methods

destination

Returns the destination of the callout line, in map coordinates.

destinationIsPinned

Returns True if the destination of the callout has pinned (manually placed).

origin

Returns the origin of the callout line, in map coordinates.

originIsPinned

Returns True if the origin of the callout has pinned (manually placed).

setDestination

Sets the destination of the callout line, in map coordinates.

setDestinationIsPinned

Sets whether the destination of the callout has pinned (manually placed).

setOrigin

Sets the origin of the callout line, in map coordinates.

setOriginIsPinned

Sets whether the origin of the callout has pinned (manually placed).

Attributes

destination(self) QPointF

Returns the destination of the callout line, in map coordinates.

The destination of the callout line is the line point associated with the feature’s geometry.

See also

setDestination()

See also

origin()

Return type:

QPointF

destinationIsPinned(self) bool

Returns True if the destination of the callout has pinned (manually placed).

The destination of the callout line is the line point associated with the feature’s geometry.

See also

originIsPinned()

Return type:

bool

featureId
layerID
origin(self) QPointF

Returns the origin of the callout line, in map coordinates.

The origin of the callout line is the line point associated with the label text.

See also

setOrigin()

See also

destination()

Return type:

QPointF

originIsPinned(self) bool

Returns True if the origin of the callout has pinned (manually placed).

The origin of the callout line is the line point associated with the label text.

Return type:

bool

providerID
setDestination(self, destination: QPointF | QPoint)

Sets the destination of the callout line, in map coordinates.

The destination of the callout line is the line point associated with the feature’s geometry.

See also

destination()

See also

setOrigin()

Parameters:

destination (Union[QPointF) –

setDestinationIsPinned(self, pinned: bool)

Sets whether the destination of the callout has pinned (manually placed).

The destination of the callout line is the line point associated with the feature’s geometry.

Parameters:

pinned (bool) –

setOrigin(self, origin: QPointF | QPoint)

Sets the origin of the callout line, in map coordinates.

The origin of the callout line is the line point associated with the label text.

See also

origin()

See also

setDestination()

Parameters:

origin (Union[QPointF) –

setOriginIsPinned(self, pinned: bool)

Sets whether the origin of the callout has pinned (manually placed).

The origin of the callout line is the line point associated with the label text.

See also

originIsPinned()

Parameters:

pinned (bool) –