So currently a tool I developed has the ability to open two types of files - .xml & .tormatx(.tormatxis just a unique extension I'm using to enable users to not save them as .xml; just for consistency reasons)

Qt Code:
  1. void Tormat_Main::open( const QString &p_fn ) {
  2. QString fileName;
  3. if( p_fn.isEmpty() ) { // ask user for a file
  4.  
  5. fileName = QFileDialog::getOpenFileName(this, tr("Open State"),
  6. baseFolder, tr("TomatFiles (*.tormatx*.xml)"));
  7.  
  8. if (fileName.isEmpty()) { return; }
  9. } else { // use passed file
To copy to clipboard, switch view to plain text mode 

Thats the code for opening a file...

My question is, how do I make it so if a user opens up a .xml extension, the program will automatically convert it to .xsps without any user interaction????

Thanks for the help guys