Class: QgsCalloutRegistry

class qgis.core.QgsCalloutRegistry

Bases: sip.wrapper

Registry of available callout classes.

QgsCalloutRegistry is not usually directly created, but rather accessed through QgsApplication.calloutRegistry().

Added in version 3.10:

Methods

addCalloutType

Registers a new callout type.

calloutMetadata

Returns the metadata for specified the specified callout type.

calloutTypes

Returns a list of all available callout types.

createCallout

Creates a new instance of a callout, given the callout type and properties.

defaultCallout

Create a new instance of a callout with default settings.

addCalloutType(self, metadata: QgsCalloutAbstractMetadata | None) bool

Registers a new callout type.

Ownership of metadata is transferred to the registry.

Parameters:

metadata (Optional[QgsCalloutAbstractMetadata])

Return type:

bool

calloutMetadata(self, type: str | None) QgsCalloutAbstractMetadata | None

Returns the metadata for specified the specified callout type. Returns None if no matching callout style was found.

Parameters:

type (Optional[str])

Return type:

Optional[QgsCalloutAbstractMetadata]

calloutTypes(self) List[str]

Returns a list of all available callout types.

Return type:

List[str]

createCallout(self, type: str | None, properties: Dict[str, Any] = {}, context: QgsReadWriteContext = QgsReadWriteContext()) QgsCallout | None

Creates a new instance of a callout, given the callout type and properties.

The caller takes ownership of the callout.

createCallout(self, type: Optional[str], element: QDomElement, context: QgsReadWriteContext) -> Optional[QgsCallout] Creates a new instance of a callout of the specified type, using the properties from a DOM element.

The caller takes ownership of the callout.

Parameters:
  • type (Optional[str])

  • properties (Dict[str)

  • context (QgsReadWriteContext = QgsReadWriteContext())

Return type:

Optional[QgsCallout]

defaultCallout() QgsCallout | None

Create a new instance of a callout with default settings.

The caller takes ownership of the callout.

Return type:

Optional[QgsCallout]