I want to open a pdf file with the default browser. I try this:

Qt Code:
  1. QString path=QApplication::applicationDirPath()+"/manual.pdf";
  2. QUrl url;
  3. url.fromLocalFile(path);
  4. QDesktopServices::openUrl(url);
To copy to clipboard, switch view to plain text mode 

The path variable is ok, but the url variable is empty. Anyone knows what happend? or how to open a pdf file with qt (only a viewer)?

Thanks in advance