Class: QgsPathResolver

class qgis.core.QgsPathResolver(baseFileName: str = '')

Bases: sip.wrapper

Initialize path resolver with a base filename. Null filename means no conversion between relative/absolute path

QgsPathResolver(QgsPathResolver)

Resolves relative paths into absolute paths and vice versa. Used for writing

New in version 3.0.

Parameters

baseFileName

readPath(self, filename: str) → str

Turn filename read from the project file to an absolute path

Parameters

filename (str) –

Return type

str

writePath(self, filename: str) → str

Prepare a filename to save it to the project file. Creates an absolute or relative path according to the project settings. Paths written to the project file should be prepared with this method.

Parameters

filename (str) –

Return type

str