How do I get a list of application suggestions for a given file type in Qt5?

57 Views Asked by At

Background Information: I'm building a small cross-desktop application using Qt5. I want to limit this application to only one specific task. Anything else should be delegated to other applications installed on the user's system. More concretely:

  1. I want my application to be opened by other applications, such as image viewers, and be suggested in context menus (e.g. "Open with..").
  2. I want my application to present the user with a list of applications he or she can use to continue working with the result. (e.g. image viewers' "open with" menu option).

As far as I can tell, input integration can not be implemented in a desktop agnostic way; i.e. I must install .desktop application files in XDG desktops or define appropriate keys under HKEY_CLASSES_ROOT\Applications in the windows registry before the desktop can suggest the applications to users.

Question: Since my application will be responsible for providing the user with a list of applications to open the output, does Qt offer anything I can use to limit the amount of platform-specific code I need to write and test?

I have already found many ways to get this information in a desktop-specific way (e.g. Gnome, KDE, or even processing XDG directories or relevant windows registry entries directly) but my hope here is to limit the the amount of time I need to spend on each desktop.

Thank you for your time and apologies for the poor English.

0

There are 0 best solutions below