QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
Public Member Functions | List of all members
QgsLocalizedDataPathRegistry Class Reference

A registry class to hold localized data paths which can be used for basemaps, logos, etc. More...

#include <qgslocalizeddatapathregistry.h>

Public Member Functions

 QgsLocalizedDataPathRegistry ()
 
QString globalPath (const QString &localizedPath) const
 Returns the global path if the file has been found in one of the paths, an empty string otherwise. More...
 
QString localizedPath (const QString &globalPath) const
 Returns the localized path if the file has been found in one of the path, an empty string otherwise. More...
 
QStringList paths () const
 Returns a list of registered localized paths. More...
 
void registerPath (const QString &path, int position=-1)
 Registers a localized path If position is given, the path is inserted at the given position in the list Since the paths are stored by order of preference, lower positions in the list take precedence. More...
 
void setPaths (const QStringList &paths)
 Sets the complete list of localized path. More...
 
void unregisterPath (const QString &path)
 Unregisters a localized path. More...
 

Detailed Description

A registry class to hold localized data paths which can be used for basemaps, logos, etc.

Paths are meant to be absolute paths and are stored by order of preference.

If a layer from one of the paths is loaded, it will be saved as localized in the project file. For instance, if you have C:/my_maps in your localized paths, C:/my_maps/my_country/ortho.tif will be save in your project as localized:my_country/ortho.tif.

The resolving of the file paths happens in QgsPathResolver.

Since
QGIS 3.14

Definition at line 41 of file qgslocalizeddatapathregistry.h.

Constructor & Destructor Documentation

◆ QgsLocalizedDataPathRegistry()

QgsLocalizedDataPathRegistry::QgsLocalizedDataPathRegistry ( )

Definition at line 24 of file qgslocalizeddatapathregistry.cpp.

Member Function Documentation

◆ globalPath()

QString QgsLocalizedDataPathRegistry::globalPath ( const QString &  localizedPath) const

Returns the global path if the file has been found in one of the paths, an empty string otherwise.

Definition at line 29 of file qgslocalizeddatapathregistry.cpp.

◆ localizedPath()

QString QgsLocalizedDataPathRegistry::localizedPath ( const QString &  globalPath) const

Returns the localized path if the file has been found in one of the path, an empty string otherwise.

Definition at line 40 of file qgslocalizeddatapathregistry.cpp.

◆ paths()

QStringList QgsLocalizedDataPathRegistry::paths ( ) const

Returns a list of registered localized paths.

Definition at line 52 of file qgslocalizeddatapathregistry.cpp.

◆ registerPath()

void QgsLocalizedDataPathRegistry::registerPath ( const QString &  path,
int  position = -1 
)

Registers a localized path If position is given, the path is inserted at the given position in the list Since the paths are stored by order of preference, lower positions in the list take precedence.

Definition at line 78 of file qgslocalizeddatapathregistry.cpp.

◆ setPaths()

void QgsLocalizedDataPathRegistry::setPaths ( const QStringList &  paths)

Sets the complete list of localized path.

Definition at line 62 of file qgslocalizeddatapathregistry.cpp.

◆ unregisterPath()

void QgsLocalizedDataPathRegistry::unregisterPath ( const QString &  path)

Unregisters a localized path.

Definition at line 97 of file qgslocalizeddatapathregistry.cpp.


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