Hi friends,

How do I set the name of a file in the window dialog QFileDialog? With this code below I can do this by putting the name "test.xml" as the file name, but this is correct? What is the best way?

Qt Code:
  1. QFileDialog dialogFile(this);
  2. dialogFile.setDefaultSuffix("xml");
  3. QString filename = dialogFile.getSaveFileName(this, QString::FromUtf8("Save file - XML distr."), tr("test.xml"), tr(".xml"));
To copy to clipboard, switch view to plain text mode 

Thanks,

Marcelo E. Geyer