I have set a file to be read-only (right click and check readonly). Now when I try to remove the file using the function bool QDir::remove(const QString & fileName)
bool QDir::remove(const QString & fileName)
QDir::remove() function is not a static function. so you can create QDir with parent file path and call then remove it:
QDir dir(parent's directory);
and then
dir.remove(fileName);