Help request for flatpak / non-flatpak Qt FileDialog


maybe not Kde related, but I’m having unexpected behavior with apps using the flatpak Kde runtime, specifically Qt5 QFileDialog, for saving a file.
If directly run on the host os the filename is suggested/prefilled based on the current file, if run as flatpak it is not/blank.
See below for a detailed description and what I figured out so far.

Maybe somebody can point me to one of the following things:
A) Is the issue with the app, the portal frontend (the Kde runtime), the portal backend (the host os) or is the non-flatpak app behaving the wrong
B) A more fitting place to ask for help
C) Some Qt app where both ways act consistent


Reproducible, by opening a file and hit “Save as”.
If build and run directly on the host, the currently opened filename is suggested for saving.
If run as flatpak app the field for the filename on the file-chooser is left blank.
Both times the app is compiled from the same source code.

Here is the chain of code/events for the flatpak:

  1. The app uses QFileDialog::getSaveFileName with a valid “dir” argument, including the filename. (I’d guess this is the wrong way, but I cannot see an alternative?)
  2. The kde-runtime / portal frontend send a dbus message with “current_file” and “current_folder” set, but no “current_name”. (Is this the intended way?)
  3. The desktop-portal backend on the host does not suggest a filename. I tried xdg-desktop-portal-kde and xdg-desktop-portal-gtk. (Looks reasonable, but is this the intended way?)

Useful links