Qt之設(shè)置文件的讀寫(xiě)屬性
?QString?imagePath?=QCoreApplication::applicationDirPath()+"/good.png"; ?if?(QFile::exists(imagePath)) ?{ ??????QFile?file(imagePath); ??????file.setPermissions(QFile::ReadOther?|?QFile::WriteOther); ?}
把圖片good.png屬性設(shè)置為只讀,通過(guò)上述代碼可以將只讀屬性去掉。