QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
qgsprofilesourceregistry.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsprofilesourceregistry.cpp
3 --------------------------------------
4 Date : April 2024
5 Copyright : (C) 2024 by Germán Carrillo
6 Email : german at opengis dot ch
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
16
18
23
25{
26 qDeleteAll( mSources );
27}
28
29QList< QgsAbstractProfileSource * > QgsProfileSourceRegistry::profileSources() const
30{
31 return mSources;
32}
33
35{
36 if ( !mSources.contains( profileSource ) )
37 mSources.append( profileSource );
38}
39
41{
42 const int index = mSources.indexOf( profileSource );
43 if ( index >= 0 )
44 delete mSources.takeAt( index );
45}
Interface for classes which can generate elevation profiles.
void registerProfileSource(QgsAbstractProfileSource *source)
Registers a profile source and takes ownership of it.
QList< QgsAbstractProfileSource * > profileSources() const
Returns a list of registered profile sources.
void unregisterProfileSource(QgsAbstractProfileSource *source)
Unregisters a profile source and destroys its instance.
QgsProfileSourceRegistry()
Constructor - creates a registry of profile sources.