Qt之设置文件的读写属性
扫描二维码
随时随地手机看文章
QString imagePath =QCoreApplication::applicationDirPath()+"/good.png"; if (QFile::exists(imagePath)) { QFile file(imagePath); file.setPermissions(QFile::ReadOther | QFile::WriteOther); }
把图片good.png属性设置为只读,通过上述代码可以将只读属性去掉。