Open file with my app
-
Where can I find an idea to create the code needed to open a certain type of file (eg audio file) with the desktop app I created with Qt?
-
@UnitScan Can you be more precise? What do you want to do with the file? Do you want to play media files? Do you want read/write files?
For reading/writing files read documentation: https://doc.qt.io/qt-5/qfile.html -
@jsulm
Purely at a guess, I suspect the OP would like to know how to connect/associate a file type to open with his Qt application? On whatever platform he might be on.... -
@JonB said in Open file with my app:
@jsulm
Purely at a guess, I suspect the OP would like to know how to connect a file type to open with his Qt application?Yes, this! I'm on Windows
-
@UnitScan This is OS specific. For windows see https://wiki.qt.io/Assigning_a_file_type_to_an_Application_on_Windows
-
@UnitScan
Unless there is a better method, https://wiki.qt.io/Assigning_a_file_type_to_an_Application_on_Windows seem to go through this for you by altering the registry under Windows.P.S.
Furthermore, if you are distributing your application and use the the Qt Installer, you might look to look at https://stackoverflow.com/questions/32316361/how-can-i-make-file-association-in-qt-installer1-5-0. -
Yes, I had already read this article, but in my case how should I adapt the code? The files I should open with my app are audio files (.mp3, .ogg, .m4a etc.)