Open File /w Native Application
I just started developing under QT 4.1 so I am pretty new to the classes.
Is there a simple way to open a file with its native application.
I know about QProcess, but I don't think that is what I want.
Example:
I have an .xml file called ErrorLog.xml. I want to open that error log with what ever the default .xml reader is. How would I go about this?
Thanks for the help!
Brandon P.
Re: Open File /w Native Application
Re: Open File /w Native Application
Quote:
Originally Posted by bpetty
I just started developing under QT 4.1 so I am pretty new to the classes.
Is there a simple way to open a file with its native application.
I know about QProcess, but I don't think that is what I want.
Example:
I have an .xml file called ErrorLog.xml. I want to open that error log with what ever the default .xml reader is. How would I go about this?
Thanks for the help!
Qt 4.2 will have functionality for this. Read more at http://doc.trolltech.com/4.2/qdesktopservices.html
Re: Open File /w Native Application
I guess I don't understand how QDesktopServices accomplishes this.
It appears to be a web oriented thing... all I want is to open a file, like test.txt, in notepad under windows or kate under linux... if that is their native viewer.
or open a .pdf in what ever they have set to open .pdf's. I dont see how this is accomplished with the URL system QDesktopServices uses.
Does anyone have an example of how to open a file /w the native "viewer" using QDesktopServices? Maybe I just don't see it.
Thanks,
Brandon P.
Re: Open File /w Native Application
Quote:
Originally Posted by
bpetty
I guess I don't understand how QDesktopServices accomplishes this.
It appears to be a web oriented thing... all I want is to open a file, like test.txt, in notepad under windows or kate under linux... if that is their native viewer.
or open a .pdf in what ever they have set to open .pdf's. I dont see how this is accomplished with the URL system QDesktopServices uses.
Does anyone have an example of how to open a file /w the native "viewer" using QDesktopServices? Maybe I just don't see it.
Something pretty much the same was just recently discussed in this thread. See especially post #6 by wysota (there's an example for you).