Simply test if fileName is not empty
Qt Code:
  1. if( !fileName.isEmpty() )
  2. {
  3. QFile::copy....
  4. }
To copy to clipboard, switch view to plain text mode