QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | 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.
 
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.
 
QStringList paths () const
 Returns a list of registered localized paths.
 
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.
 
void setPaths (const QStringList &paths)
 Sets the complete list of localized path.
 
void unregisterPath (const QString &path)
 Unregisters a localized path.
 

Static Public Attributes

static const QgsSettingsEntryStringListsettingsLocalizedDataPaths = new QgsSettingsEntryStringList( QStringLiteral( "localized_data_paths" ), QgsSettingsTree::sTreeQgis, QStringList() )
 Settings entry localized data paths.
 

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 45 of file qgslocalizeddatapathregistry.h.

Constructor & Destructor Documentation

◆ QgsLocalizedDataPathRegistry()

QgsLocalizedDataPathRegistry::QgsLocalizedDataPathRegistry ( )

Definition at line 26 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 31 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 42 of file qgslocalizeddatapathregistry.cpp.

◆ paths()

QStringList QgsLocalizedDataPathRegistry::paths ( ) const

Returns a list of registered localized paths.

Definition at line 54 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 80 of file qgslocalizeddatapathregistry.cpp.

◆ setPaths()

void QgsLocalizedDataPathRegistry::setPaths ( const QStringList &  paths)

Sets the complete list of localized path.

Definition at line 64 of file qgslocalizeddatapathregistry.cpp.

◆ unregisterPath()

void QgsLocalizedDataPathRegistry::unregisterPath ( const QString &  path)

Unregisters a localized path.

Definition at line 99 of file qgslocalizeddatapathregistry.cpp.

Member Data Documentation

◆ settingsLocalizedDataPaths

const QgsSettingsEntryStringList * QgsLocalizedDataPathRegistry::settingsLocalizedDataPaths = new QgsSettingsEntryStringList( QStringLiteral( "localized_data_paths" ), QgsSettingsTree::sTreeQgis, QStringList() )
static

Settings entry localized data paths.

Definition at line 74 of file qgslocalizeddatapathregistry.h.


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