Here's what you are doing:
  • You store the actual bytes of the PDF file into the database
  • You retrieve the actual bytes of the PDF file and try to interpret those bytes as a URL
  • You use a QTextEdit to display a string made from the URL and expect to see the PDF file.

Does this sound correct to you?

Go back and read the earlier responses about your options.