Details
-
Suggestion
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
6.x
-
None
-
Every platform that Qt supports is affected by QFile not having such an ability to overwrite a file.
Description
I suggest a parameter named allow_overwrite be added to the instance method and also to the static method of QFile.
So, a developer could then do...
QFile.copy("path/source_file.extension", "path/target_file.extension", allow_overwrite=True)
or
file_manager = QFile("path/source_file.extension")
file_manager.copy("path/target_file.extension", allow_overwrite=True)
It's cumbersome that if we need to overwrite a file, we must remove the target file - if it exists by checking with QFile.exists("path/target_file.extension") - and then do a copy. For large files or files from the Internet, this introduces an overhead.