Class: QgsElevationProfileManager

Manages storage of a set of elevation profiles.

QgsElevationProfileManager handles the storage, serializing and deserializing of elevation profiles. Usually this class is not constructed directly, but rather accessed through a QgsProject via QgsProject.elevationProfileManager().

QgsElevationProfileManager retains ownership of all the profiles contained in the manager.

Added in version 4.0.

Class Hierarchy

Inheritance diagram of qgis.core.QgsElevationProfileManager

Base classes

QgsProjectStoredObjectManagerBase

Manages storage of a set of objects attached to a QgsProject.

QObject

class qgis.core.QgsElevationProfileManager[source]

Bases: QgsProjectStoredObjectManagerBase

__init__(project: QgsProject | None = None)

Constructor for QgsElevationProfileManager. The project will become the parent object for this manager.

Parameters:

project (Optional[QgsProject] = None)

addProfile(self, profile: QgsElevationProfile | None) bool[source]

Adds a profile to the manager.

Ownership of the profile is transferred to the manager.

Returns True if the addition was successful, or False if the profile could not be added (eg as a result of a duplicate profile name).

See also

removeProfile()

See also

profileAdded()

Parameters:

profile (Optional[QgsElevationProfile])

Return type:

bool

clear(self)[source]

Removes and deletes all profiles from the manager.

See also

removeProfile()

generateUniqueTitle(self) str[source]

Generates a unique title for a new profile, which does not clash with any already contained by the manager.

Return type:

str

signal profileAboutToBeAdded[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

signal profileAboutToBeRemoved[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

signal profileAdded[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

profileByName(self, name: str | None) QgsElevationProfile | None[source]

Returns the profile with a matching name, or None if no matching profiles were found.

Parameters:

name (Optional[str])

Return type:

Optional[QgsElevationProfile]

signal profileRemoved[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

signal profileRenamed[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

profiles(self) List[QgsElevationProfile]

Returns a list of all profiles contained in the manager.

Return type:

List[QgsElevationProfile]

readXml(self, element: QDomElement, doc: QDomDocument, context: QgsReadWriteContext) bool[source]

Reads the manager’s state from a DOM element, restoring all profiles present in the XML document.

See also

writeXml()

Parameters:
Return type:

bool

removeProfile(self, profile: QgsElevationProfile | None) bool[source]

Removes a profile from the manager. The profile is deleted.

Returns True if the removal was successful, or False if the removal failed (eg as a result of removing a profile which is not contained in the manager).

See also

addProfile()

See also

profileRemoved()

See also

clear()

Parameters:

profile (Optional[QgsElevationProfile])

Return type:

bool

resolveReferences(self, project: QgsProject | None)[source]

After reading settings from XML, resolves references to any layers in a project that have been read as layer IDs.

See also

readXml()

Parameters:

project (Optional[QgsProject])

virtual setupObjectConnections(self, profile: QgsElevationProfile | None)[source]
Parameters:

profile (Optional[QgsElevationProfile])

writeXml(self, doc: QDomDocument, context: QgsReadWriteContext) QDomElement[source]

Returns a DOM element representing the state of the manager.

See also

readXml()

Parameters:
Return type:

QDomElement