转到QT C 应用上Android/ios上下载的设备根路径

Go to device root path of Downloads on Android/iOS on Qt C++ app

本文关键字:路径 下载 QT 应用 Android 转到 ios      更新时间:2023-10-16

希望一切都很好。我正在尝试在QT C 应用程序上访问Android和iOS上下载的设备根路径。到目前为止,我的代码:

mPath = "~/Downloads";
dirmodel = new QFileSystemModel (this);
dirmodel->setFilter(QDir::AllDirs | QDir::NoDotAndDotDot);
dirmodel->setRootPath(mPath);

预先感谢。

您需要使用qstandardpaths类。它为您提供QstandardPaths :: DownloadLocation。根据平台,它将自动转化为正确的位置。