每次启动应用程序时,都会调用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";
}
最佳答案
我弄清楚了为什么它似乎并非每次都创建。每次我从QtCreator运行的应用程序libWierszeApp.so文件夹都被删除,内容也被删除。从设备运行应用程序时,一切正常。我认为可以将其报告为错误。