Search code examples
qtoverwriteqfiledialog

How to disable overwrite confirmation?


I have following code QFiledialog fd; QString dirpath = fd.getSaveFileName(this);

Here I don't want QFiledialog to prompt for over write confirmation when I select file to get it's path

Thanks in advance.


Solution

  • Pass QFileDialog::DontConfirmOverwrite as parameter, look at the documentation for getSaveFileName function here.