Class: QgsCalloutPosition

Represents the calculated placement of a map label callout line.

Added in version 3.20.

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