I am currently wondering how you can determine which filter the user selected with using QFileDialog::getSaveFileName().

I currently have it written as so, and have no idea how to implement it. I saw something about QFileDialog::selectedNameFilter() but would have no idea how to implement.

Qt Code:
  1. bool VashTextEditor::saveAs()
  2. {
  3. QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), QDir::homePath(),
  4. tr("Vash Text Editor Files (*.vte);;Python (*.py);;C++ (*.cpp *.h *.cxx *.c)"));
  5. if (fileName.isEmpty())
  6. return false;
  7.  
  8. return saveFile(fileName);
  9. }
To copy to clipboard, switch view to plain text mode 

any help would be greatly appreciated and thanks in advance.