Hi to all,
with a QFileDialog I choose a file in my hard disk to process it.
I would to print (with a cout) only the filename instead of the whole path.

Here the code

Qt Code:
  1. void CoinWidget::openAudioTrack()
  2. {
  3. QString audioFileName = QFileDialog::getOpenFileName( "../media",
  4. tr("Audio (*.wav *.mp3);;All Files(*)"),
  5. this,
  6. "open file dialog",
  7. "Choose an audio track");
  8.  
  9. if(!audioFileName.isEmpty())
  10. {
  11. cout << audioFileName.latin1() << endl; //<-----this print the whole path
  12.  
  13. // retrieve the root separator
  14. SoSeparator *lroot = model->getRoot();//about coin3d
  15.  
  16. m_sound->setAudioTrack(audioFileName.latin1());
  17. m_sound->enableContinuousPlay(true);
  18. m_sound->setVolume(0.5f);
  19. m_sound->playTrack();
  20. }
  21. else
  22. {
  23. cout << "No file selected" << endl;
  24. return;
  25. }
  26. }
To copy to clipboard, switch view to plain text mode 

Where I wrote "this print the whole path" I also would print the filename istead.
Any idea?
Regards