View Full Version : copy the file from the filedialog and paste into into a different directory

30th January 2015, 11:30

i just want to copy a csv file from source- desktop(example)(the file is free from all the permissions) by selecting the file from the selection window using QFileDialog the file selected must be copied into a new location(directory) after clicking the Ok button from the file dialog.

Any one please let me know how to proceed with it. ica just able to open the file dialog and select the file.

Thanks in advance.

30th January 2015, 14:00


30th January 2015, 17:56
Please, read the documentation first. As anda_skoa has noticed, copying files: QFile::copy(). As to the dialogs, there are predefined dialogs QFileDialog::getOpenFileName() and QFileDialog::getSavedFileName(). The dialogs are static methods of QFileDialog, you don't need to add anything, just call them.