Class: QgsBalloonCallout

A cartoon talking bubble callout style.

Added in version 3.20.

Class Hierarchy

Inheritance diagram of qgis.core.QgsBalloonCallout

Base classes

QgsCallout

Abstract base class for callout renderers.

Methods

cornerRadius

Returns the corner radius of the balloon shapes.

cornerRadiusMapUnitScale

Returns the map unit scale for the corner radius.

cornerRadiusUnit

Returns the units for the corner radius.

fillSymbol

Returns the fill symbol used to render the callout.

margins

Returns the margins between the outside of the callout frame and the label's bounding rectangle.

marginsUnit

Returns the units for the margins between the outside of the callout frame and the label's bounding rectangle.

markerSymbol

Returns the marker symbol used to render the callout endpoint.

offsetFromAnchor

Returns the offset distance from the anchor point at which to start the line.

offsetFromAnchorMapUnitScale

Returns the map unit scale for the offset from anchor.

offsetFromAnchorUnit

Returns the units for the offset from anchor point.

setCornerRadius

Sets the radius of the corners for the balloon shapes.

setCornerRadiusMapUnitScale

Sets the map unit scale for the corner radius.

setCornerRadiusUnit

Sets the unit for the corner radius.

setFillSymbol

Sets the fill symbol used to render the callout.

setMargins

Sets the margins between the outside of the callout frame and the label's bounding rectangle.

setMarginsUnit

Sets the unit for the margins between the outside of the callout frame and the label's bounding rectangle.

setMarkerSymbol

Sets the marker symbol used to render the callout endpoint.

setOffsetFromAnchor

Sets the offset distance from the anchor point at which to start the line.

setOffsetFromAnchorMapUnitScale

Sets the map unit scale for the offset from anchor.

setOffsetFromAnchorUnit

Sets the unit for the offset from anchor distance.

setWedgeWidth

Sets the width of the wedge shape at the side it connects with the label.

setWedgeWidthMapUnitScale

Sets the map unit scale for the wedge width.

setWedgeWidthUnit

Sets the unit for the wedge width.

wedgeWidth

Returns the width of the wedge shape at the side it connects with the label.

wedgeWidthMapUnitScale

Returns the map unit scale for the wedge width.

wedgeWidthUnit

Returns the units for the wedge width.

Static Methods

create

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

class qgis.core.QgsBalloonCallout[source]

Bases: QgsCallout

cornerRadius(self) float[source]

Returns the corner radius of the balloon shapes.

Units are specified through wedgeWidthUnit().

Return type:

float

cornerRadiusMapUnitScale(self) QgsMapUnitScale

Returns the map unit scale for the corner radius.

See also

cornerRadius()

Return type:

QgsMapUnitScale

cornerRadiusUnit(self) Qgis.RenderUnit[source]

Returns the units for the corner radius.

See also

cornerRadius()

Return type:

Qgis.RenderUnit

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

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

Parameters:
Return type:

Optional[QgsCallout]

fillSymbol(self) QgsFillSymbol | None[source]

Returns the fill symbol used to render the callout.

Ownership is not transferred.

See also

setFillSymbol()

Return type:

Optional[QgsFillSymbol]

margins(self) QgsMargins

Returns the margins between the outside of the callout frame and the label’s bounding rectangle.

Units are retrieved via marginsUnit()

Note

Negative margins are acceptable.

See also

setMargins()

See also

marginsUnit()

Return type:

QgsMargins

marginsUnit(self) Qgis.RenderUnit[source]

Returns the units for the margins between the outside of the callout frame and the label’s bounding rectangle.

See also

setMarginsUnit()

See also

margins()

Return type:

Qgis.RenderUnit

markerSymbol(self) QgsMarkerSymbol | None[source]

Returns the marker symbol used to render the callout endpoint.

May be None, if no endpoint marker will be used.

The marker will always be rendered below the fill symbol for the callout.

Ownership is not transferred.

Added in version 3.40.

Return type:

Optional[QgsMarkerSymbol]

offsetFromAnchor(self) float[source]

Returns the offset distance from the anchor point at which to start the line. Units are specified through offsetFromAnchorUnit().

Return type:

float

offsetFromAnchorMapUnitScale(self) QgsMapUnitScale

Returns the map unit scale for the offset from anchor.

Return type:

QgsMapUnitScale

offsetFromAnchorUnit(self) Qgis.RenderUnit[source]

Returns the units for the offset from anchor point.

Return type:

Qgis.RenderUnit

setCornerRadius(self, radius: float)[source]

Sets the radius of the corners for the balloon shapes.

Units are specified through setCornerRadiusUnit().

See also

cornerRadius()

Parameters:

radius (float)

setCornerRadiusMapUnitScale(self, scale: QgsMapUnitScale)[source]

Sets the map unit scale for the corner radius.

Parameters:

scale (QgsMapUnitScale)

setCornerRadiusUnit(self, unit: Qgis.RenderUnit)[source]

Sets the unit for the corner radius.

Parameters:

unit (Qgis.RenderUnit)

setFillSymbol(self, symbol: QgsFillSymbol | None)[source]

Sets the fill symbol used to render the callout. Ownership of symbol is transferred to the callout.

See also

fillSymbol()

Parameters:

symbol (Optional[QgsFillSymbol])

setMargins(self, margins: QgsMargins)[source]

Sets the margins between the outside of the callout frame and the label’s bounding rectangle.

Units are set via setMarginsUnit()

Note

Negative margins are acceptable.

See also

margins()

See also

setMarginsUnit()

Parameters:

margins (QgsMargins)

setMarginsUnit(self, unit: Qgis.RenderUnit)[source]

Sets the unit for the margins between the outside of the callout frame and the label’s bounding rectangle.

See also

margins()

See also

marginsUnit()

Parameters:

unit (Qgis.RenderUnit)

setMarkerSymbol(self, symbol: QgsMarkerSymbol | None)[source]

Sets the marker symbol used to render the callout endpoint. Ownership of symbol is transferred to the callout.

Set to None to disable the endpoint marker.

The marker will always be rendered below the fill symbol for the callout.

See also

markerSymbol()

Added in version 3.40.

Parameters:

symbol (Optional[QgsMarkerSymbol])

setOffsetFromAnchor(self, distance: float)[source]

Sets the offset distance from the anchor point at which to start the line. Units are specified through setOffsetFromAnchorUnit().

Parameters:

distance (float)

setOffsetFromAnchorMapUnitScale(self, scale: QgsMapUnitScale)[source]

Sets the map unit scale for the offset from anchor.

Parameters:

scale (QgsMapUnitScale)

setOffsetFromAnchorUnit(self, unit: Qgis.RenderUnit)[source]

Sets the unit for the offset from anchor distance.

Parameters:

unit (Qgis.RenderUnit)

setWedgeWidth(self, width: float)[source]

Sets the width of the wedge shape at the side it connects with the label.

Units are specified through setWedgeWidthUnit().

See also

wedgeWidth()

Parameters:

width (float)

setWedgeWidthMapUnitScale(self, scale: QgsMapUnitScale)[source]

Sets the map unit scale for the wedge width.

See also

setWedgeWidth()

Parameters:

scale (QgsMapUnitScale)

setWedgeWidthUnit(self, unit: Qgis.RenderUnit)[source]

Sets the unit for the wedge width.

See also

wedgeWidthUnit()

See also

setWedgeWidth()

Parameters:

unit (Qgis.RenderUnit)

wedgeWidth(self) float[source]

Returns the width of the wedge shape at the side it connects with the label.

Units are specified through wedgeWidthUnit().

See also

setWedgeWidth()

See also

wedgeWidthUnit()

Return type:

float

wedgeWidthMapUnitScale(self) QgsMapUnitScale

Returns the map unit scale for the wedge width.

See also

wedgeWidthUnit()

See also

wedgeWidth()

Return type:

QgsMapUnitScale

wedgeWidthUnit(self) Qgis.RenderUnit[source]

Returns the units for the wedge width.

See also

wedgeWidth()

Return type:

Qgis.RenderUnit