IIRC Qt uses the org.kde.StatusNotifierItem API to display tray icons on Linux (if available). Ubuntu will include a GNOME Shell extension which provides this, see https://github.com/ubuntu/gnome-shell-extension-appindicator/blob/master/interfaces-xml/StatusNotifierItem.xml
When the screen is locked though, extensions are disabled. This results in Qt applications disappearing after locking and unlocking the screen: https://github.com/ubuntu/gnome-shell-extension-appindicator/issues/75
Can this be fixed somehow in Qt itself?