【发布时间】:2014-07-02 14:11:42
【问题描述】:
每次我启动应用程序时,都会调用 mkpath,就好像以前没有创建目录一样,尽管我总是得到“创建路径”日志。我是否需要指定任何特殊权限才能保存到内部存储中? mypath 看起来像 /data/data/org.qtproject.example.WierszeApp/files/.local/share/libWierszeApp.so/
QDir mypath(QStandardPaths::writableLocation(QStandardPaths::DataLocation));
if(!mypath.cd("images"))
{
if(mypath.mkpath("images"))
qDebug() << "path created";
else
qDebug() << "path not created";
}
else
{
qDebug() << "inside dir";
}
【问题讨论】:
-
将
android.permission.WRITE_EXTERNAL_STORAGE添加到清单文件的“权限”字段是否可以解决问题?