QDir mkpath不';不要在android上创建目录
每次我启动应用程序时,都会调用mkpath,就好像以前没有创建目录一样,尽管我总是得到“path created”日志。我是否需要指定任何特权以保存到内部存储器中QDir mkpath不';不要在android上创建目录,android,qt,qt5,qdir,Android,Qt,Qt5,Qdir,每次我启动应用程序时,都会调用mkpath,就好像以前没有创建目录一样,尽管我总是得到“path created”日志。我是否需要指定任何特权以保存到内部存储器中mypath看起来像/data/data/org.qtproject.example.WierszeApp/files/.local/share/libWierszeApp.so/ QDir mypath(QStandardPaths::writableLocation(QStandardPaths::DataLocation));
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";
}
QDir-mypath(qstandardpath::writeablelocation(qstandardpath::DataLocation));
如果(!mypath.cd(“图像”))
{
if(mypath.mkpath(“图像”))
qDebug()我弄明白了为什么每次都没有创建它。每次我从QtCreator libWierszeApp运行应用程序时,文件夹都被删除了,内容也被删除了。当你从设备运行应用程序时,一切正常。我想它可以报告为bug。添加android.permission。将外部存储写入“Permissions”fie清单文件的ld解决问题了吗?