企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
[TOC] ## 概述 查询系统的常用路径 | Path type | macOS | Windows| |---|---|---| | DesktopLocation| "~/Desktop"|"C:/Users/<USER>/Desktop"| |DocumentsLocation|"~/Documents"|"C:/Users/<USER>/Documents"| |FontsLocation |"/System/Library/Fonts" (not writable)|"C:/Windows/Fonts" (not writable)| |ApplicationsLocation|"/Applications" (not writable)|"C:/Users/<USER>/AppData/Roaming/Microsoft/Windows/Start Menu/Programs"| |MusicLocation|"~/Music"|"C:/Users/<USER>/Music"| |MoviesLocation|"~/Movies"|"C:/Users/<USER>/Videos"| |PicturesLocation|"~/Pictures"|"C:/Users/<USER>/Pictures"| |TempLocation|randomly generated by the OS|"C:/Users/<USER>/AppData/Local/Temp"| |HomeLocation|"~"|"C:/Users/<USER>"| |DataLocation|"~/Library/Application Support/<APPNAME>", "/Library/Application Support/<APPNAME>". "<APPDIR>/../Resources"|"C:/Users/<USER>/AppData/Local/<APPNAME>", "C:/ProgramData/<APPNAME>", "<APPDIR>", "<APPDIR>/data"| |CacheLocation|"~/Library/Caches/<APPNAME>", "/Library/Caches/<APPNAME>"|"C:/Users/<USER>/AppData/Local/<APPNAME>/cache"| |GenericDataLocation|"~/Library/Application Support", "/Library/Application Support"|"C:/Users/<USER>/AppData/Local", "C:/ProgramData", "<APPDIR>", "<APPDIR>/data"| |RuntimeLocation|"~/Library/Application Support"|"C:/Users/<USER>"| |ConfigLocation|"~/Library/Preferences"|"C:/Users/<USER>/AppData/Local/<APPNAME>", "C:/ProgramData/<APPNAME>"| |GenericConfigLocation|"~/Library/Preferences"|"C:/Users/<USER>/AppData/Local", "C:/ProgramData"| |DownloadLocation|"~/Downloads"|"C:/Users/<USER>/Documents"| |GenericCacheLocation|"~/Library/Caches", "/Library/Caches"|"C:/Users/<USER>/AppData/Local/cache"| |AppDataLocation|"~/Library/Application Support/<APPNAME>", "/Library/Application Support/<APPNAME>". "<APPDIR>/../Resources"|"C:/Users/<USER>/AppData/Roaming/<APPNAME>", "C:/ProgramData/<APPNAME>", "<APPDIR>", "<APPDIR>/data"| |AppLocalDataLocation|"~/Library/Application Support/<APPNAME>", "/Library/Application Support/<APPNAME>". "<APPDIR>/../Resources"|"C:/Users/<USER>/AppData/Local/<APPNAME>", "C:/ProgramData/<APPNAME>", "<APPDIR>", "<APPDIR>/data"| |AppConfigLocation|"~/Library/Preferences/<APPNAME>"|"C:/Users/<USER>/AppData/Local/<APPNAME>", "C:/ProgramData/<APPNAME>"| ## 示例 ``` qDebug()<<QStandardPaths::displayName(QStandardPaths::HomeLocation); //"Home" qDebug()<<QStandardPaths::standardLocations(QStandardPaths::HomeLocation); //("/Users/idcpj") qDebug()<<QStandardPaths::writableLocation(QStandardPaths::HomeLocation);//"/Users/idcpj" ```