The QStandardPaths class provides methods for accessing standard paths. This class contains functions to query standard locations on the local filesystem, for common tasks such as user-specific directories or system-wide configuration directories.
This enum describes the different flags that can be used for controlling the behavior of QStandardPaths::locate and QStandardPaths::locateAll. It stores an OR combination of LocateOption values. Some of the values in this enum represent a user configuration. Such enum values will return the same paths in different applications, so they could be used to share data with other applications.
Other values are specific to this application. Each enum value in the table below describes whether it's application-specific or generic. Application-specific directories should be assumed to be unreachable by other applications. Therefore, files placed there might not be readable by other applications, even if run by the same user.
On the other hand, generic directories should be assumed to be accessible by all applications run by this user, but should still be assumed to be unreachable by applications by other users.
Data interchange with other users is out of the scope of QStandardPaths. The following table gives examples of paths on different operating systems. The first path is the writable path unless noted. Other, additional paths, if any, represent non-writable locations. The paths above should not be relied upon, as they may change according to OS configuration, locale, or they may change in future Qt versions.
Note: On Android 6. This feature was added in Qt 5. See also writableLocationstandardLocationsdisplayNamelocateand locateAll. Returns a localized display name for the given location type or an empty QString if no relevant location can be found.
Finds the executable named executableName in the specified pathsor the system paths if paths is empty. On most operating systems the system path is determined by the PATH environment variable. The directories where to search for the executable can be set in the paths argument. To search in both your own paths and the system paths, call findExecutable windows 10 change local user folder name free download, once with paths set and once with paths empty.
Symlinks are not resolved in order to preserve behavior for the case of executables whose behavior depends on the name they are invoked with. For example, the findExecutable "foo" call finds foo. The options flag lets you specify whether to look for files or directories. By default, this flag is set to LocateFile. Returns the absolute path to the first file or directory found, otherwise returns an empty string. Finds all files or directories by the name, fileNamein the standard locations for type.
If testMode is truethis enables a special "test mode" in QStandardPathswhich changes writable locations to point to test directories. This prevents auto tests from reading or writing to the current user's configuration. Other locations are not affected. The list of directories is sorted from high to low priority, starting with writableLocation if it can be determined.
This list is empty if no locations for type are defined. Returns the directory where files of type should be written to, or an empty string if the location cannot be determined. Note: The storage location returned may not exist; that is, it may need to be created by the system or the user.
Documentation contributions included herein are the copyrights of their respective owners. Qt and respective logos are trademarks of The Qt Company Ltd.
All other trademarks are property of their respective owners. Detailed Description This class contains functions to query standard locations on the local filesystem, for common tasks such as user-specific directories or system-wide configuration directories. This is a generic value. The returned path is never empty.
Note that installing fonts may require additional, platform-specific operations. Windows 10 change local user folder name free download 3 Returns the directory containing the user applications either executables, application bundles, or shortcuts to them. Note that installing applications may require additional, platform-specific operations.
Files, folders or shortcuts in this directory are platform-specific. QStandardPaths::MusicLocation 4 Returns the directory containing the user's music or other audio files. If no directory specific for music files exists, a windows 10 change local user folder name free download fallback for storing user documents is returned.
If no directory specific for movie files exists, a sensible fallback for storing user documents is returned. If no directory specific for picture files exists, a sensible fallback for storing user documents is returned. The returned value might be application-specific, shared among other applications for this user, or even system-wide. This value might be generic or application-specific, but the returned path is never empty.
This enumeration value is deprecated. Using AppDataLocation is preferable windows 10 change local user folder name free download on Windows, the roaming path is recommended.
QStandardPaths::CacheLocation 10 Returns a directory location where user-specific non-essential cached data should be written. This is an application-specific directory. QStandardPaths::GenericCacheLocation 15 Returns a directory location where user-specific non-essential cached data, shared across applications, windows 10 change local user folder name free download be written. Note that the returned path may be empty if the system has no concept of shared cache.
QStandardPaths::GenericDataLocation 11 Returns a directory location where persistent data shared across applications can be stored. QStandardPaths::RuntimeLocation 12 Returns a directory location where runtime communication files should be written, like Unix local sockets.
The returned path may be empty on some systems. QStandardPaths::ConfigLocation 13 Returns a directory location where user-specific configuration files should be written. This may be either a generic value or application-specific, and the returned path is never empty.
If no directory specific for downloads exists, a sensible fallback for storing user documents is returned. QStandardPaths::GenericConfigLocation 16 Returns a directory location where user-specific configuration files shared between multiple applications should be written.
This is a generic value and the returned path is never empty. On the Windows operating system, this returns the roaming path. This enum value was added in Qt 5. On all other platforms, it returns the same value as AppDataLocation. QStandardPaths::AppConfigLocation 18 Returns a directory location where user-specific configuration windows 10 change local user folder name free download should be written. This is an application-specific directory, and the returned path is never empty.
Returns the absolute file path to the executable, or an empty string if not found. Returns the list of all the files that were found.
See also writableLocation. Returns the user's desktop directory. Returns the directory containing user document files.
Returns the directory containing user's fonts. Returns the directory containing the user applications either executables, application bundles, or shortcuts to them. Returns the directory containing the user's music or other audio files. Returns the directory containing the user's movies and videos.
Returns the directory containing the user's pictures or photos. Returns a directory where temporary files can be stored. Returns the user's home directory the same as QDir::homePath.
Returns the same value as AppLocalDataLocation. Returns a directory location where user-specific non-essential cached data should be written. Returns a directory location where user-specific non-essential cached data, shared across applications, should be written. Returns a directory location where persistent data shared across applications can be stored.
Returns a directory location where runtime communication files should be written, like Unix local sockets. Returns a directory location where user-specific configuration files should be written. Returns a directory for user's downloaded files. Returns a directory location where user-specific configuration files shared between multiple applications should be written.
Returns a directory location where persistent application data can be stored. Returns the local settings path on the Windows operating system.