Class: QgsCalloutRegistry¶
Registry of available callout classes.
QgsCalloutRegistry is not usually directly created, but
rather accessed through QgsApplication.calloutRegistry().
Added in version 3.10.
Methods
Registers a new callout type. |
|
Returns the metadata for specified the specified callout type. |
|
Returns a list of all available callout types. |
|
Creates a new instance of a callout, given the callout type and properties. |
Static Methods
Create a new instance of a callout with default settings. |
- class qgis.core.QgsCalloutRegistry[source]¶
Bases:
object- addCalloutType(self, metadata: QgsCalloutAbstractMetadata | None) bool[source]¶
Registers a new callout type.
Ownership of
metadatais transferred to the registry.- Parameters:
metadata (Optional[QgsCalloutAbstractMetadata])
- Return type:
bool
- calloutMetadata(self, type: str | None) QgsCalloutAbstractMetadata | None[source]¶
Returns the metadata for specified the specified callout
type. ReturnsNoneif no matching callout style was found.- Parameters:
type (Optional[str])
- Return type:
Optional[QgsCalloutAbstractMetadata]
- calloutTypes(self) List[str][source]¶
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[source]¶
Creates a new instance of a callout, given the callout
typeandproperties.The caller takes ownership of the callout.
- Parameters:
type (Optional[str])
properties (Dict[str, Any] = {})
context (
QgsReadWriteContext= QgsReadWriteContext())
- Return type:
Optional[QgsCallout]
- createCallout(self, type: str | None, element: QDomElement, context: QgsReadWriteContext) QgsCallout | None[source]
Creates a new instance of a callout of the specified
type, using the properties from a DOMelement.The caller takes ownership of the callout.
- Parameters:
type (Optional[str])
element (QDomElement)
context (
QgsReadWriteContext)
- Return type:
Optional[QgsCallout]
- static defaultCallout() QgsCallout | None[source]¶
Create a new instance of a callout with default settings.
The caller takes ownership of the callout.
- Return type:
Optional[QgsCallout]