QGIS API Documentation 3.41.0-Master (d5b93354e9c)
|
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 QgsSettingsEntryStringList * | settingsLocalizedDataPaths = new QgsSettingsEntryStringList( QStringLiteral( "localized_data_paths" ), QgsSettingsTree::sTreeQgis, QStringList() ) |
Settings entry localized data paths. | |
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 45 of file qgslocalizeddatapathregistry.h.
QgsLocalizedDataPathRegistry::QgsLocalizedDataPathRegistry | ( | ) |
Definition at line 26 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 31 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 42 of file qgslocalizeddatapathregistry.cpp.
QStringList QgsLocalizedDataPathRegistry::paths | ( | ) | const |
Returns a list of registered localized paths.
Definition at line 54 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 80 of file qgslocalizeddatapathregistry.cpp.
void QgsLocalizedDataPathRegistry::setPaths | ( | const QStringList & | paths | ) |
Sets the complete list of localized path.
Definition at line 64 of file qgslocalizeddatapathregistry.cpp.
void QgsLocalizedDataPathRegistry::unregisterPath | ( | const QString & | path | ) |
Unregisters a localized path.
Definition at line 99 of file qgslocalizeddatapathregistry.cpp.
|
static |
Settings entry localized data paths.
Definition at line 74 of file qgslocalizeddatapathregistry.h.