Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

[SOLVED] Qt4 QFileDialog getSaveFileName can't overwrite existing file

$
0
0
Hi, I’m using following line to get filename to save data. const QString fname = QFileDialog::getSaveFileName(this, tr("Datei Speichern unter..."), QDir::toNativeSeparators(savedir + "/" + this->m_fname)); In case the file with same filename is already exist(or user selects the existing file), QFileDialog asks user to “Replace or not replace” the file, if user clicks “Yes”(replace existing), QFileDialog shows message box with error like “File can not be saved. Please try again”… Selected file at the moment is not locked/opened/used and i can simply delete it with Explorer without any warnings or errors… What can be wrong? How to ignore or deactivate this check in QFileDialog? I only need the filename, it will be checked in another place for existence and write permission… I have also tried to set DontConfirmOverwrite, but it just does not shows “Replace or not replace” dialog, but shows the error message anyway…. Any idea how to get rid of that? Me stupid…. MessageBox with error come from my code some lines below…. I hate monday…..

Viewing all articles
Browse latest Browse all 13965

Trending Articles