Hi friends,
How to copy a file from one directory to another
Hi friends,
How to copy a file from one directory to another
it is not working...
QFile::copy(qApp->applicationDirPath(),"E:\\projects_Qt_main\\ISRO_ SAC\\Data_Encode_Decode\\DataEncoder\\File_Receive r_Transmitter -\\Added");
Added is the folder to copy file.....
The syntax isCheck your arguments, also check the return value.Qt Code:
To copy to clipboard, switch view to plain text mode
http://doc.qt.io/qt-4.8/qfile.html#copy-2
(1) You need to copy a file to a file. Your first argument is a directory, not a file.
(2) Note that copy() does not overwrite. If the target file exists, nothing will be copied and you get false in return. If you need overwriting, delete the target file first.
(3) In Qt, use forward slashes, even in windows. Therefore: "E:/projects_etc/and_so_on"
Bookmarks