Change QT app theme in XFCE

I used to use gnome manjaro, now I reinstalled XFCE manjaro using the same user.
My QT app doesn’t use the theme I use. I used specific dark theme but all qt app are light.

tried to follow this guide: https://www.reddit.com/r/debian/comments/homch1/xfce4_qt_applications_themeslook_how_to_manage/
But ~/.profile doesn’t exist. Adding QT_QPA_PLATFORMTHEME=qt5ct in .bash_profile doesn’t work.
Creating ~/.profile and ~/.zprofile then adding QT_QPA_PLATFORMTHEME=qt5ct inside each file doesn’t work either.

How do I fix this qt themes?

When a configuration file is changed, it must be sourced in the current shell to reflect the change:

source ~/.profile

So I tried making .profile again. And execute source ~/.profile.
I made .profile by copying them from freshly installed manjaro xfce with new user and I found that it should be export QT_QPA_PLATFORMTHEME="qt5ct" and not QT_QPA_PLATFORMTHEME=qt5ct.

now qt theme selector is using the correct theme. And theme applied correctly to some qt apps such as audacious. But it’s not applied to qbittorrent and smplayer. I am pretty sure qbittorrent use correct gtk theme when I was using Gnome. And it also uses correct dark theme in freshly installed manjaro xfce4 with new user.

What else could be the issue?

Change the theme in the Qt5 Configuration Tool (qt5ct) to match your Gtk theme, perhaps?

Which is?

Is adwaita-icon-theme , adwaita-qt5 , adwaita-qt6 , libadwaita installed ?
if done, open qt5ct and set to adwaita-dark.

If you want to change the theme of Libadwaita applications on another Gtk desktop
like Xfce or Cinnamon, you can use the following commands:

Light Adwaita theme:

gsettings set org.gnome.desktop.interface color-scheme default

Dark Adwaita theme:

gsettings set org.gnome.desktop.interface color-scheme prefer-dark

my ~/.profile is default:

export EDITOR=/usr/bin/nano
export QT_QPA_PLATFORMTHEME="qt5ct"
export QT_AUTO_SCREEN_SCALE_FACTOR=0
export GTK2_RC_FILES="$HOME/.gtkrc-2.0"

I don’t like/use kvantum, it is not even installed on my system (it is an alien IMO and does not belong to xfce).
Now themes like adwaita, greybird, colloid, fluent, yaru, … will work fine in light and dark variants.

Those packages are not related to qt5ct. There’s already an Adwaita theme included.

Please see: Uniform look for Qt and GTK applications - ArchWiki

1 Like

Adwaita

Adwaita is the default GNOME theme. The GTK 3 version is included in the gtk3 package, while the GTK 2 version is in gnome-themes-extra. adwaita-qt is a Qt port of the Adwaita theme. Unlike #QGtkStyle, which mimics the GTK 2 theme, it provides a native Qt style made to look like the GTK 3 Adwaita. It can be installed with the adwaita-qt4AUR, adwaita-qt5 and adwaita-qt6 packages (it might require some time for compiling) for the Qt 4, 5 and 6 versions, respectively.

Not one thing you mentioned is related the the user’s issue nor what I just said.

Ergghh… I guess that Arch wiki article needs some work.

Adwaita-Qt is a Fedora theme required by QGnomePlatform. Again, these are not related to the included themes with qt5ct.

Here are the possible values:

# Available options: gtk2, gnome, kde, qt5ct, xcb
QT_QPA_PLATFORMTHEME=""

# Available styles: HighContrastInverse, HighContrast, Adwaita-HighContrastInverse,
# Adwaita-HighContrast, Adwaita-Dark, Adwaita, kvantum-dark, kvantum, qt5ct-style,
# Windows, Fusion
QT_STYLE_OVERRIDE=""

For Gtk desktops, neither environment variables need to be set at all for QGnomePlatform. Just install qgnomeplatform-qt5 & qgnomeplatform-qt6 which depend on adwaita-qt5 & adwaita-qt6 respectively.

E17gtk-revolved


Ehm my bad… it looks like, it the issue was the theme I’m using. Because qt theme doesn’t change directly when we changed the settings, combined with closing qbittorrent doesn’t close the actual app, it confuses me.

If I used theme that I previously used in gnome, Vertex-Dark, qbittorrent will use dark time just like before. It’s definitely not vertex-dark but it was dark nonetheless.

So now that I realized the behavior are the same with freshly installed xfce user, I am relieved. I’ll check out that article on archwiki.

But I still wonder why qbittorrent isn’t using theme from qt5ct. Is it because it’s not qt5?

Indeed. QBitttorrent uses Qt 6 now. Also install qt6ct.

Note that I edited my above reply a few times. :point_up:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.