diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index 9295070dc8a..7e7c16c4660 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -654,6 +654,13 @@ QFile::rename(const QString &newName) return true; } + // Engine was unable to rename and the fallback will delete the original file, + // so we have to back out here on case-insensitive file systems: + if (changingCase) { + d->setError(QFile::RenameError, d->fileEngine->errorString()); + return false; + } + if (isSequential()) { d->setError(QFile::RenameError, tr("Will not rename sequential file using block copy")); return false;