QStandardPaths
lastmod 2026-11-10created 2014-08-283 edits
QStandardPaths is a class added in Qt 5 that reports standard directory locations, which differ by operating system, in a uniform way. Passing enum values such as AppDataLocation, ConfigLocation, CacheLocation, and DocumentsLocation to writableLocation() and standardLocations() returns the appropriate path for each of Windows, macOS, and Linux (XDG specification), and findExecutable() can also locate executables in PATH. It is used to decide where to store configuration files and caches without platform-specific code.
The QStandardPaths class provides methods for accessing standard paths.