Open a File from Explorer in my Qt application
-
Hi,
My application is writing files. I would like to open such a file in my application, if it is clicked on in the Windows explorer. For this, I think once I have to set open with to my application. If I understand it correctly, my application is then called with the file name as argument.
Is it also possible to open a file in an already running instance of my application (it is possible to have several files open at once)
Thanks!
-
You could take a look at QtSingleApplication
-
Hi,
If you mean associate your application with your custom file type then you have to configure your OS for that.
-
Hi SGaist,
Yes, thats what I mean. But once I have associated a file type with my application, what happens next? Does e.g. Windows (which will be the main target platform, although we also support Linux) simply call my application executable (and gives it the file name as argument?) or is there a more complicated mechanism?
-
Now that I know its called associating I found this:
https://wiki.qt.io/Assigning_a_file_type_to_an_Application_on_Windows -
Nice ! Thanks for sharing your finding !