Something for after you manage to open a file...

If you intended writing a PDF document's binary data to the file then I suggest you do not want a QTextStream for reasons I hope would be obvious.