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¶
Base classes¶
Manages storage of a set of objects attached to a |
|
Methods
Adds a profile to the manager. |
|
Removes and deletes all profiles from the manager. |
|
Generates a unique title for a new profile, which does not clash with any already contained by the manager. |
|
Returns the profile with a matching name, or |
|
Returns a list of all profiles contained in the manager. |
|
Reads the manager's state from a DOM element, restoring all profiles present in the XML document. |
|
Removes a profile from the manager. |
|
After reading settings from XML, resolves references to any layers in a project that have been read as layer IDs. |
|
Returns a DOM element representing the state of the manager. |
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsElevationProfileManager. See the FAQ for more details.
Signals
Emitted when a profile is about to be added to the manager |
|
Emitted when a profile is about to be removed from the manager |
|
Emitted when a profile has been added to the manager |
|
Emitted when a profile was removed from the manager |
|
Emitted when a profile is renamed |
- 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, orFalse
if the profile could not be added (eg as a result of a duplicate profile name).See also
See also
- Parameters:
profile (Optional[QgsElevationProfile])
- Return type:
bool
- 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(name: str)[source]¶
Emitted when a profile is about to be added to the manager
- Parameters:
name (str)
- signal profileAboutToBeRemoved(name: str)[source]¶
Emitted when a profile is about to be removed from the manager
- Parameters:
name (str)
- signal profileAdded(name: str)[source]¶
Emitted when a profile has been added to the manager
- Parameters:
name (str)
- 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(name: str)[source]¶
Emitted when a profile was removed from the manager
- Parameters:
name (str)
- signal profileRenamed(profile: QgsElevationProfile, newName: str)[source]¶
Emitted when a profile is renamed
- Parameters:
profile (QgsElevationProfile)
newName (str)
- 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
See also
- Parameters:
element (QDomElement)
doc (QDomDocument)
context (QgsReadWriteContext)
- 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, orFalse
if the removal failed (eg as a result of removing a profile which is not contained in the manager).See also
See also
See also
See also
- 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
- 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
- Parameters:
doc (QDomDocument)
context (QgsReadWriteContext)
- Return type:
QDomElement