[SOLVED]save a png file
In my application I create a png file and save it in a directory (named result.png). I want to get this image without using a dialog box from this directory and then save it in an other directory using a dialog box.How could this be done? I hope someone could help.
So let me see if I got this correct. You create an Image and save it in some directory as result.png and then you want to copy it to another directory, while the user can choose the directory with a file dialog (QFileDialog::getExistingDirectory [doc.qt.nokia.com]). To copy, you can either use QFile::copy or just open one file, read it into a QByteArray (I would suggest to adjust the size of the read depending on memory and harddrive sector size) and write that back to a different file.
To copy an image from one directory to another should be something like the following code. But I want to copy two files for 3D images (.hdr, .img), which are located in the same directory. How I could copy these both two image files in an other directory by using the same QFileDialog for saving images?
I have tried this and I get my results. But with this method I open a QFileDialog twice. Is there any method to do the same thing just using QFileDialog once?