0
点赞
收藏
分享

微信扫一扫

Qt5获取系统目录


Qt4使用 QDesktopServices::storageLocation(QDesktopServices::xxxx) 来获取一些系统目录,Qt5则要改成 QStandardPaths::writableLocation(QStandardPaths::xxxx)


所需头文件:


#include <QDesktopServices>


然后可以通过如下语句获取不同的路径:



QString QStandardPaths::writableLocation(StandardLocation type)


也可以通过一下语句获取路径下的文件和文件夹:



QStringList QStandardPaths::standardLocations(StandardLocation type)


参数为路径名字的指代值,列表如下:


Qt5获取系统目录_#include

Qt5获取系统目录_qt5_02

举报

相关推荐

0 条评论