I made a small program that saves a file, but people who use Ubuntu say that they can't properly save the file without manually putting a file extension in the save file name. I tried using the setDefaultSuffix function though I don't see how it would fit with the getSaveFileName function that I'm using.

Here's my code for the save button:
Qt Code:
  1. void MainWindow::on_save_clicked()
  2. {
  3. if (pngData.isEmpty())
  4. {
  5. QPixmap noSaveData(":/graphic/noSaveData.png");
  6. ui->preview->setStyleSheet("background: transparent ;");
  7. ui->preview->setPixmap(noSaveData);
  8. return;
  9. }
  10. QString filename = QFileDialog::getSaveFileName(this, ("Save Skin"), "C:/Users/", ("PNG Image (*.png)"));
  11. QFile file(filename);
  12. file.open(QIODevice::WriteOnly);
  13. file.write(pngData);
  14. file.close();
  15. }
To copy to clipboard, switch view to plain text mode