Get Qt5 Apps To Use Native Gtk+ Style In Ubuntu Or Debian

Some Qt5 applications don't use a Gtk+ style by default in Gnome (in Ubuntu 18.04 for example), which makes them look out of place. This includes applications like VirtualBox, VLC, qBittorrent, Simple Screen Recoder, the ownCloud desktop client, and so on.

This article explains how to fix this and get Qt5 applications to use a Gtk+ 2 style in Debian or Ubuntu (and Linux distributions based on Ubuntu that use a Gnome desktop, like Pop!_OS).

VLC and VirtualBox before and after using the tweak in this article, on Ubuntu 18.04:

  • Before:

VirtualBox qt5 ugly Ubuntu 18.04

vlc qt5 ugly Ubuntu 18.04

  • After:

VirtualBox qt5 gtk+ style Ubuntu 18.04

vlc qt5 gtk+ style Ubuntu 18.04

Related: Use Custom Themes For Qt Applications On Linux With Kvantum

To fix this issue and get Qt5 applications to use a Gtk+ style, all you have to do is follow the simple steps below.

1. Install qt5-style-plugins, a package which contains Cleanlooks, Motif, Plastique, and Gtk+ 2 Qt5 styles.

sudo apt install qt5-style-plugins

2. Set Qt5 applications to use the Gtk+ 2 style by adding export QT_QPA_PLATFORMTHEME=gtk2 to your ~/.profile. To do this with a simple command, run the following:

echo "export QT_QPA_PLATFORMTHEME=gtk2" >> ~/.profile

3. Log out after installing this package.

After logging back in, Qt5 applications like qBittorrent, VLC, or Virtualbox should use a Gtk+ style on your Gnome desktop in Debian or Ubuntu (and Pop!_OS, which is based on Ubuntu).

It's important to note that this solves the issue for applications installed via apt / deb. This tweak does not work for applications installed using Snap, Flatpak, or AppImage packages. At least that was the case on my Ubuntu 18.04 desktop.