Question

I am making a qt application which allows the user to select a file and then upon clicking ok, start the associated program with the file already loaded. The program I want to start is java based, and I know how to use QProcess to get it to open, I don't know however how to add the file extension which the user is selecting. Any suggestions?

Was it helpful?

Solution 2

Sorry for leaving everyone hanging on this one, I actually solved this issue myself. Basically I just used QFileDialog to select my file I wanted to open and created a QString which was the entire command line I needed to use to get my application to run properly, which I opened via QProcess. Thanks for the help anyways.

OTHER TIPS

Did you try QDesktopServices::openUrl() ?

You can pass your program path and name as an Url (file:///) and it will be openned with a suitable application.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top