PDA

View Full Version : Launching a PDF in platform independant way



JPNaude
30th September 2008, 12:45
Hi

I'm trying to find out what is the best way to open a PDF from within a Qt application. I looked at QProcess but I'm not convinced that this is the best solution. Does a solution exist where a class looks at the program associated with a file extension such as a pdf in a platform independant way and launches the PDF with that program?

I suspect that such a class will also be able to open a path in the correct way, for example in windows using windows explorer and in a different operating system using the appropriate application.

If such a class exist, please point me in the right direction.

Thanks
Jaco

JPNaude
30th September 2008, 13:52
Found something on the web about this:
http://lists.trolltech.com/qt-interest/2005-03/thread01357-0.html

Not able to test it yet though.

Cheers
Jaco

jpn
30th September 2008, 19:04
Use QDesktopServices::openUrl().