SelectFile() is returning NULL
Hello,
I want to retrieve selected file name from file dialog. I am using selectfile() function for this but it is not returning the value.
Below is the code snippet please let me know what is the problem.
Code:
SavePage()
{
dialog.setMinimumSize(240, 320);
dialog.resize(240,320);
dialog.setConfirmOverwrite(false);
if (dialog.exec())
dialog.selectFile (fileName);
else
return;
// Open a file and Save in it
}
Re: SelectFile() is returning NULL
according to you code fileName is an empty string, line 9.
QFileDialog::selectFile takes a const reference, so it should not modify fileName.
Re: SelectFile() is returning NULL
Which function should I used to retrieve file name of the selected file?
Re: SelectFile() is returning NULL
Re: SelectFile() is returning NULL
...or use the static QFileDialog::getSaveFileName() and check if empty.
Re: SelectFile() is returning NULL
I tried using this getSavefileName() static method but I was not able to resize it's window size. I am developing application for mobile device hence I want to resize the dialog window as per my device resolution.
Re: SelectFile() is returning NULL
Thanks!! Problem is solved.