Opening a file using operating system default program for the file type
-
wrote on 9 Sept 2013, 11:49 last edited by
Hi,
I have a number of file names attached to an entry in a database. I simply want the user to be able to open the file in the default program.
Something like this:
@QFancyClass()->openFileUsingDefaultMimeHandler(myfilename).@I've had a look at QProcess, QFile and QDir, but I'm still not sure how to do this. I've most likely missed something; I'd appreciate any pointers!
Thanks in advance.
Edit: I have no need to communicate with the spawned process or anything, I just want to launch it.
-
Use QDesktopServices:
@
QDesktopServices::openUrl(QUrl::fromUserInput("path/to/the/file"));
@ -
wrote on 9 Sept 2013, 12:31 last edited by
Excellent, thank you very much!
1/3