Qt5 applications don't use gtk style on Liux Mint

I found the solution after reading https://wiki.archlinux.org/index.php/Uniform_Look_for_Qt_and_GTK_Applications:

Qt5 decides the style to use based on what desktop environment is used. If it doesn't recognize the desktop environment, it falls back to a generic style. To force a specific style, you can set the QT_STYLE_OVERRIDE environment variable. Specifically, set it to gtk if you want to use the gtk theme. Qt5 applications also support the -style flag, which you can use to launch a Qt5 application with a specific style.

So I added this line to my $HOME/.profile

export QT_STYLE_OVERRIDE=gtk

I was struggling with getting Qt5 to use the native style on Linux Mint (18, Cinnamon) for a Qt5 installation I downloaded myself. What seems to work in the end is

$ unset QT_STYLE_OVERRIDE

I think this variable is set by cinnamon-session itself (grepping the binary returns a match) so there is no easy way to unset it.

Tags:

Gtk

Qt

Linux Mint