Run QT Apps under Wayland with XWayland

On Fedora, when launching GNOME under a Wayland session (which is the default), every QT application will also run under Wayland. Unfortunately, this will cause a lot of problems with most of the QT apps that I use. Mainly I have experienced serious issues with RenderDoc and qutebrowser. RenderDoc refuses to capture applications under Wayland and qutebrowser does not play videos under Wayland. However, the GNOME Wayland experience is really good and I don’t want to run GNOME in an X session. There is a program called XWayland, which allows apps in Wayland to run in an X session. I searched for a way to run all my QT apps with this XWayland server. Turned out this is pretty easy, just open the file .bash_profile in your home directory and write at the end of the file:

export QT_QPA_PLATFORM=xcb

With this environment variable set, all QT apps will run with XWayland in a Wayland session. I think this should work with other distros as well.