PDA

View Full Version : getSaveFileName overwrite check question



Lexrst
9th October 2008, 21:05
Hello all,

I'm using Qt 4.3.3 and openSuse 10.3.

Seeing what I think is a bug but I don't see it listed in the Task Tracker on the Trolltech site.

Using the static funtion QFileDialog::getSaveFileName() and it works as expected, except for one case. This is when the user chooses a file name that matches a file that exists in the system and the overwrite check is enabled. In this case when you press the save button on the dialog it displays a warning message box with the text:

"foo.bin already exists. Do you want to replace it?"

with a yes and no button in the dialog. The issue I'm seeing is that when I press the no button, the warning dialog and the file dialog both go away. I thought that when the user selected the no button it was supposed to bring them back to the file dialog, so they can specify a different filename. Also there is no way in code (that I can find) to detect that the user pressed the no button in the warning dialog, so when I check the filename returned from getSaveFileName it's not null and not empty so I assume the user pressed Save.(per the documentation)

Am I missing something in how I do this or is this not working as it should?

jpn
12th October 2008, 09:26
I thought that when the user selected the no button it was supposed to bring them back to the file dialog, so they can specify a different filename.
This is the way it works for me with Qt/X11 4.4.2.