Returns the absolute path of the user's home directory.
Under Windows this function will return the directory of the current user's profile. Typically, this is:
Use the toNativeSeparators() function to convert the separators to the ones that are appropriate for the underlying operating system.
If the directory of the current user's profile does not exist or cannot be retrieved, the following alternatives will be checked (in the given order) until an existing and available path is found:
1 The path specified by the
USERPROFILE environment variable. The path formed by concatenating the
HOMEPATH environment variables. The path specified by the
HOME environment variable. The path returned by the rootPath() function (which uses the
SystemDrive environment variable) The
Under non-Windows operating systems the
HOME environment variable is used if it exists, otherwise the path returned by the rootPath() function is used.
- See also:
- home(), currentPath(), rootPath(), tempPath()
Definition at line 1916 of file qdir.cpp.
Referenced by QCleanlooksStyle::polish(), and QDesktopServices::storageLocation().