Class: QgsProfileSourceRegistry

Registry of profile sources used by QgsProfilePlotRenderer.

QgsProfileSourceRegistry is not usually directly created, but rather accessed through QgsApplication.profileSourceRegistry().

Added in version 3.38.

Class Hierarchy

Inheritance diagram of qgis.core.QgsProfileSourceRegistry

Base classes

QObject

Methods

findSourceById

Finds a registered profile source by id.

profileSources

Returns a list of registered profile sources.

registerProfileSource

Registers a profile source and takes ownership of it.

unregisterProfileSource

Unregisters a profile source and destroys its instance.

Signals

profileSourceRegistered

Signal emitted once a profile source is registered.

profileSourceUnregistered

Signal emitted once a profile source is unregistered.

class qgis.core.QgsProfileSourceRegistry[source]

Bases: QObject

__init__()

Constructor - creates a registry of profile sources

findSourceById(self, sourceId: str | None) QgsAbstractProfileSource | None[source]

Finds a registered profile source by id. Returns None if the source is not found in the registry.

Parameters:

sourceId (Optional[str]) – Id of the source to be found in the registry.

Added in version 4.0.

Return type:

Optional[QgsAbstractProfileSource]

signal profileSourceRegistered(sourceId: str, sourceName: str)[source]

Signal emitted once a profile source is registered.

Parameters:
  • sourceId (str) – Unique identifier of the profile source that has been registered.

  • sourceName (str) – Name of the profile source that has been registered.

Added in version 4.0.

signal profileSourceUnregistered(sourceId: str)[source]

Signal emitted once a profile source is unregistered.

Parameters:

sourceId (str) – Unique identifier of the profile source that has been unregistered.

Added in version 4.0.

profileSources(self) List[QgsAbstractProfileSource]

Returns a list of registered profile sources.

Return type:

List[QgsAbstractProfileSource]

registerProfileSource(self, source: QgsAbstractProfileSource | None) bool[source]

Registers a profile source and takes ownership of it.

Returns True if the profile source could be registered and False otherwise.

Parameters:

source (Optional[QgsAbstractProfileSource])

Return type:

bool

unregisterProfileSource(self, source: QgsAbstractProfileSource | None) bool[source]

Unregisters a profile source and destroys its instance.

Deprecated since version 4.0: Unregister the profile source by ID instead.

Parameters:

source (Optional[QgsAbstractProfileSource])

Return type:

bool

unregisterProfileSource(self, sourceId: str | None) bool[source]

Unregisters a profile source by a given ID and destroys its instance.

Returns True if the source id was found in the registry and False otherwise.

Parameters:

sourceId (Optional[str]) – Profile source ID to be unregistered.

Added in version 4.0.

Return type:

bool