I'm using the QWebEnginePage function printToPdf() to save a pdf file. I then want to open it in the appropriate application using QDesktopServices. When I try to do this, I am getting a ShellExecute failed error 2 (file not found). My problem seems to be that QDesktopServices tries to open the pdf before it is finished being created, because if I try to open that same exact same PDF using QDesktopServices the next time the program is run (by hardcoding the path in so it grabs the previously generated pdf as opposed to the one being created concurrently) it works fine. It there a way to determine when printToPdf has completed so I can trigger QDesktopServices after that? I can't seem to find any information on the topic other than this question from 8 months ago that remains unanswered.