Class: QgsCalloutPosition

Represents the calculated placement of a map label callout line.

Added in version 3.20.

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

featureId

ID of feature associated with this callout.

layerID

ID of associated map layer.

providerID

ID of the associated label provider.

class qgis.core.QgsCalloutPosition[source]

Bases: object

__init__(id: int, layer: str | None, providerId: str | None = '')

Constructor for QgsCalloutPosition.

Parameters:
  • id (int) – associated feature ID

  • layer (Optional[str]) – ID of associated map layer

  • providerId (Optional[str] = '') – ID of associated label provider

__init__()
__init__(a0: QgsCalloutPosition)
Parameters:

a0 (QgsCalloutPosition)

destination(self) QPointF[source]

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[source]

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: QgsFeatureId

ID of feature associated with this callout.

layerID: str

ID of associated map layer.

origin(self) QPointF[source]

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[source]

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: str

ID of the associated label provider.

setDestination(self, destination: QPointF | QPoint)[source]

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, QPoint])

setDestinationIsPinned(self, pinned: bool)[source]

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)[source]

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, QPoint])

setOriginIsPinned(self, pinned: bool)[source]

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)