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 |
|
- 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
profileto the manager.Ownership of the profile is transferred to the manager.
Returns
Trueif the addition was successful, orFalseif 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[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
Noneif 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:
- 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
profilefrom the manager. The profile is deleted.Returns
Trueif the removal was successful, orFalseif 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
projectthat 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