Hi,
I using the QFileDialog-Class to show a save dialog and want to set a default filename in that dialog. I'm using the following code to do this:

Variant 1:
Qt Code:
  1. QString title = "Where to save \"" + concerningDownload->getTitle() + "\"?";
  2. QString default = defaultDir + "/" concerningDownload->getTitle();
  3. QFileDialog::getSaveFileName(this, title, default);
To copy to clipboard, switch view to plain text mode 

Variant 2:
Qt Code:
  1. QFileDialog fileDlg(this);
  2. fileDlg.setDirectory(default);
  3. fileDlg.setFileMode(QFileDialog::AnyFile);
  4. fileDlg.setAcceptMode(QFileDialog::AcceptSave);
  5.  
  6. if(fileDlg.exec() && fileDlg.selectedFiles().count() == 1)
  7. //...
To copy to clipboard, switch view to plain text mode 

The problem is, that the default filename doesn't appear in the dialog (the initial directory is set correctly). The problem concerns only the native file dialog of Windows 7 (and I suppose Windows Vista and 8, too). On Windows XP and on Linux the problem doesn't appear. I don't think the problem is in my Code, because it works on XP, Linux and the "Unnative" file dialog.

Does someone know a way to fix that bug or why it appears? Generally the native file dialog of Windows 7 supports default filenames (I tested that with C#).

I'm using Qt 5.0.1 (minGW build).