I had to modify the following line:
QFile oldFile(outFileName);
to
QFile oldFile(dest + outFileName);
Or as @Riateche mentioned in his comment, remove oldFile and fileInfo variables completely and do:
QFileInfo(dest+outFileName).created();