"Open with" in Qt5 application

At the moment, I have experimentally implemented the following:
Added QPA check for flags in application resources: QT:QPA_FLAGS (possible values ​​are Q_REF_TO_ARGV, Q_REF_TO_FORK, Q_KILL_ON_EXIT)

Q_REF_TO_ARGV - modify argv array by received REFS
Q_REF_TO_FORK - for received REFS, award a new instance of the process with the received files as parameters.
Q_KILL_ON_EXIT - to kill the process on exit (in some applications, unfortunately, this is still required, some apps crashed on exit when global static objects deletion)

By default (if no flags are specified), all workarounds are disabled.

You can add flags by simply writing the following line in rdef for an example:
resource (“QT: QPA_FLAGS”) “QT_REF_TO_ARGV | QT_REF_TO_FORK”;

At the moment I have tested this on several programs:
Picard - no flags: open files from Tracker-> OpenWith works fine, drop to application icon in Deskbar works fine, drop to application icon in Tracker works fine
KWrite - no flags: open files from Tracker-> OpenWith works fine, drop to application icon in Deskbar works fine, drop to application icon in Tracker works fine
Notepadqq - QT_REF_TO_ARGV | QT_REF_TO_FORK: open files from Tracker-> OpenWith works fine, drop to application icon in Deskbar works fine, drop to application icon in Tracker works fine

Does it make sense to include it in the release or not?

3 Likes