QT版本: 5.12.6
头文件:
#include <QStandardPaths>
示例代码:
qDebug()<<"系统字体目录路径:"<<QStandardPaths::standardLocations(QStandardPaths::FontsLocation);
qDebug()<<"系统桌面目录路径:"<<QStandardPaths::standardLocations(QStandardPaths::DesktopLocation);
qDebug()<<"用户文档目录路径:"<<QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation);
qDebug()<<"用户音乐目录路径:"<<QStandardPaths::standardLocations(QStandardPaths::MusicLocation);
qDebug()