QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
QgsElevationProfileManager Class Reference

Manages storage of a set of elevation profiles. More...

#include <qgselevationprofilemanager.h>

Inheritance diagram for QgsElevationProfileManager:

Signals

void profileAboutToBeAdded (const QString &name)
 Emitted when a profile is about to be added to the manager.
void profileAboutToBeRemoved (const QString &name)
 Emitted when a profile is about to be removed from the manager.
void profileAdded (const QString &name)
 Emitted when a profile has been added to the manager.
void profileRemoved (const QString &name)
 Emitted when a profile was removed from the manager.
void profileRenamed (QgsElevationProfile *profile, const QString &newName)
 Emitted when a profile is renamed.
Signals inherited from QgsProjectStoredObjectManagerBase
void objectAboutToBeAdded (const QString &name)
 Emitted when an object is about to be added to the manager.
void objectAboutToBeRemoved (const QString &name)
 Emitted when an object is about to be removed from the manager.
void objectAdded (const QString &name)
 Emitted when an object has been added to the manager.
void objectRemoved (const QString &name)
 Emitted when an object was removed from the manager.

Public Member Functions

 QgsElevationProfileManager (QgsProject *project=nullptr)
 Constructor for QgsElevationProfileManager.
 ~QgsElevationProfileManager () override
bool addProfile (QgsElevationProfile *profile)
 Adds a profile to the manager.
void clear ()
 Removes and deletes all profiles from the manager.
QString generateUniqueTitle () const
 Generates a unique title for a new profile, which does not clash with any already contained by the manager.
QgsElevationProfileprofileByName (const QString &name) const
 Returns the profile with a matching name, or nullptr if no matching profiles were found.
QList< QgsElevationProfile * > profiles () const
 Returns a list of all profiles contained in the manager.
bool readXml (const QDomElement &element, const QDomDocument &doc, const QgsReadWriteContext &context)
 Reads the manager's state from a DOM element, restoring all profiles present in the XML document.
bool removeProfile (QgsElevationProfile *profile)
 Removes a profile from the manager.
void resolveReferences (const QgsProject *project)
 After reading settings from XML, resolves references to any layers in a project that have been read as layer IDs.
QDomElement writeXml (QDomDocument &doc, const QgsReadWriteContext &context) const
 Returns a DOM element representing the state of the manager.
Public Member Functions inherited from QgsAbstractProjectStoredObjectManager< QgsElevationProfile >
 QgsAbstractProjectStoredObjectManager (QgsProject *project=nullptr)
 Constructor for QgsAbstractProjectStoredObjectManager, for objects attached to the specified project.
 ~QgsAbstractProjectStoredObjectManager () override
QgsElevationProfileobjectByName (const QString &name) const
 Returns the object with a matching name, or nullptr if no matching objects were found.
QList< QgsElevationProfile * > objects () const
 Returns the list of objects contained within the manager.
Public Member Functions inherited from QgsProjectStoredObjectManagerBase
 QgsProjectStoredObjectManagerBase (QgsProject *project=nullptr)
 Constructor for QgsProjectStoredObjectManagerBase, for objects attached to the specified project.

Protected Member Functions

void setupObjectConnections (QgsElevationProfile *profile) override
Protected Member Functions inherited from QgsAbstractProjectStoredObjectManager< QgsElevationProfile >
bool addObject (QgsElevationProfile *object)
 Adds an object to the manager.
void clearObjects ()
 Removes and deletes all objects from the manager.
bool removeObject (QgsElevationProfile *object)
 Removes an object from the manager.
virtual void setupObjectConnections (QgsElevationProfile *object)
 Sets up additional connections to an object, called when the object is first added to the manager.
Protected Member Functions inherited from QgsProjectStoredObjectManagerBase
void markProjectDirty ()
 Marks the project as dirty.

Additional Inherited Members

Protected Attributes inherited from QgsAbstractProjectStoredObjectManager< QgsElevationProfile >
QList< QgsElevationProfile * > mObjects
 Attached objects, owned by the manager.
Protected Attributes inherited from QgsProjectStoredObjectManagerBase
QgsProjectmProject = nullptr
 Associated project.

Detailed Description

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.

Since
QGIS 4.0

Definition at line 49 of file qgselevationprofilemanager.h.

Constructor & Destructor Documentation

◆ QgsElevationProfileManager()

QgsElevationProfileManager::QgsElevationProfileManager ( QgsProject * project = nullptr)
explicit

Constructor for QgsElevationProfileManager.

The project will become the parent object for this manager.

Definition at line 24 of file qgselevationprofilemanager.cpp.

◆ ~QgsElevationProfileManager()

QgsElevationProfileManager::~QgsElevationProfileManager ( )
override

Definition at line 34 of file qgselevationprofilemanager.cpp.

Member Function Documentation

◆ addProfile()

bool QgsElevationProfileManager::addProfile ( QgsElevationProfile * profile)

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()
profileAdded()

Definition at line 39 of file qgselevationprofilemanager.cpp.

◆ clear()

void QgsElevationProfileManager::clear ( )

Removes and deletes all profiles from the manager.

See also
removeProfile()

Definition at line 49 of file qgselevationprofilemanager.cpp.

◆ generateUniqueTitle()

QString QgsElevationProfileManager::generateUniqueTitle ( ) const

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

Definition at line 121 of file qgselevationprofilemanager.cpp.

◆ profileAboutToBeAdded

void QgsElevationProfileManager::profileAboutToBeAdded ( const QString & name)
signal

Emitted when a profile is about to be added to the manager.

◆ profileAboutToBeRemoved

void QgsElevationProfileManager::profileAboutToBeRemoved ( const QString & name)
signal

Emitted when a profile is about to be removed from the manager.

◆ profileAdded

void QgsElevationProfileManager::profileAdded ( const QString & name)
signal

Emitted when a profile has been added to the manager.

◆ profileByName()

QgsElevationProfile * QgsElevationProfileManager::profileByName ( const QString & name) const

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

Definition at line 59 of file qgselevationprofilemanager.cpp.

◆ profileRemoved

void QgsElevationProfileManager::profileRemoved ( const QString & name)
signal

Emitted when a profile was removed from the manager.

◆ profileRenamed

void QgsElevationProfileManager::profileRenamed ( QgsElevationProfile * profile,
const QString & newName )
signal

Emitted when a profile is renamed.

◆ profiles()

QList< QgsElevationProfile * > QgsElevationProfileManager::profiles ( ) const

Returns a list of all profiles contained in the manager.

Definition at line 54 of file qgselevationprofilemanager.cpp.

◆ readXml()

bool QgsElevationProfileManager::readXml ( const QDomElement & element,
const QDomDocument & doc,
const QgsReadWriteContext & context )

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

See also
resolveReferences()
writeXml()

Definition at line 64 of file qgselevationprofilemanager.cpp.

◆ removeProfile()

bool QgsElevationProfileManager::removeProfile ( QgsElevationProfile * profile)

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()
profileRemoved()
profileAboutToBeRemoved()
clear()

Definition at line 44 of file qgselevationprofilemanager.cpp.

◆ resolveReferences()

void QgsElevationProfileManager::resolveReferences ( const QgsProject * project)

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

See also
readXml()

Definition at line 113 of file qgselevationprofilemanager.cpp.

◆ setupObjectConnections()

void QgsElevationProfileManager::setupObjectConnections ( QgsElevationProfile * profile)
overrideprotected

Definition at line 139 of file qgselevationprofilemanager.cpp.

◆ writeXml()

QDomElement QgsElevationProfileManager::writeXml ( QDomDocument & doc,
const QgsReadWriteContext & context ) const

Returns a DOM element representing the state of the manager.

See also
readXml()

Definition at line 102 of file qgselevationprofilemanager.cpp.


The documentation for this class was generated from the following files: