How to rename a file?
General and Desktop
5
Posts
4
Posters
17.8k
Views
1
Watching
-
How to rename a file? in code?
-
"Rename a file":http://qt-project.org/doc/qt-4.8/qfile.html#rename
-
You don't need to open it or even create a variable. There's a static method on QFile, it even moves the file if needed:
QFile::rename("C:/oldlocation/oldname.txt", "C:/newlocation/newname.txt");