QGIS API Documentation
3.20.0-Odense (decaadbb31)
|
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... | |
Static Public Attributes | |
static const QgsSettingsEntryStringList | settingsLocalizedDataPaths = QgsSettingsEntryStringList( QStringLiteral( "/qgis/localized_data_paths" ), QgsSettings::NoSection, QStringList() ) |
Settings entry localized data paths. More... | |
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.
Definition at line 42 of file qgslocalizeddatapathregistry.h.
QgsLocalizedDataPathRegistry::QgsLocalizedDataPathRegistry | ( | ) |
Definition at line 24 of file qgslocalizeddatapathregistry.cpp.
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.
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.
QStringList QgsLocalizedDataPathRegistry::paths | ( | ) | const |
Returns a list of registered localized paths.
Definition at line 52 of file qgslocalizeddatapathregistry.cpp.
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.
void QgsLocalizedDataPathRegistry::setPaths | ( | const QStringList & | paths | ) |
Sets the complete list of localized path.
Definition at line 62 of file qgslocalizeddatapathregistry.cpp.
void QgsLocalizedDataPathRegistry::unregisterPath | ( | const QString & | path | ) |
Unregisters a localized path.
Definition at line 97 of file qgslocalizeddatapathregistry.cpp.
|
inlinestatic |
Settings entry localized data paths.
Definition at line 71 of file qgslocalizeddatapathregistry.h.