how to start other Application(eg.Photoshop) in my Qt app?
-
I would use QProcess::execute to do the job.
-
Well, it depends a lot on the target platform. On windows I have no smart idea. You can of course decide to look for the exe in C:/Program Files and C:/Program Files (x86) but this will fail when people use other install path. Maybe there's a preference folder in %APPDATA% which you could detect.
-
As @JohanSolo says, it -really- depend on what platform.
If windows, you can also go look at registry
HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Photoshop
Somewhere - there is even listed where its installed so plug-ins can find the folder.On windows, you could also, just open what ever app that is listed to open the .XXX of your file.
Like
ShellExecute(0, 0, L"c:\outfile.txt", 0, 0 , SW_SHOW );Opens what ever text editor .txt is assigned too.
If you want it to be cross platform, you should use a QFileOpen Dialog to allow user to select
the exe file to use. -
thank you for all.
the best solution i think is directly open the file with the related EXE, if there is no related EXE, then open a dialog which allow the user to choose a exe to open it.
and there should be a "Open With..." menu which allow the user to choose the Defalut related EXE.of course, i want this cross-platform. however, now i am on Windows.
-
Hi,
QDesktopServices::openUrl is the tool for that