You are not logged in.

#1 2023-04-03 12:00:02

Dizzar
Member
Registered: 2023-04-03
Posts: 10

[SOLVED] QT Apps completely ignore the theme

I am trying to style my desktop in such a way that all apps look the same, but with my custom colors. To achieve this, I decided to recolor adwaita. Now, GTK apps all look fine, but all QT apps completely ignore the set theme. To make the QT recolor of adwaita I simply took the adwaita-qt PKGBUILD, downloaded sources and then replaced the _colors.scss file there with the colors I need, then just built and installed. For a DE I use XFCE4 with xfwm replaced with i3 + picom.

To set the theme, I used qt5ct (and the theme works as intended on qt5ct itself). While writing this I noticed that Spectacle uses the theme set by qt5ct, but no other app (qBittorrent and KeepassXC, to be precise) seems to use the theme. They also print nothing to the console after being run.

I set the environment variables as said on the wiki:

-> % echo $QT_QPA_PLATFORMTHEME
qt5ct
-> % echo $XDG_CURRENT_DESKTOP
GNOME

I also tried to set QT_STYLE_OVERRIDE=adwaita-dark but no luck. In fact, that option seems to be completely ignored, seeing as no matter what I set it to nothing changes.

As a note, it seems spectacle uses the correct theme so long as QT_QPA_PLATFORMTHEME variable is set correctly (which I guess should be expected from all apps).

Last edited by Dizzar (2023-04-03 14:15:26)

Offline

#2 2023-04-03 12:09:10

seth
Member
Registered: 2012-09-03
Posts: 56,483

Re: [SOLVED] QT Apps completely ignore the theme

qt5ct

allows you to configure the palette (colors)

Offline

#3 2023-04-03 12:19:51

Dizzar
Member
Registered: 2023-04-03
Posts: 10

Re: [SOLVED] QT Apps completely ignore the theme

seth wrote:
qt5ct

allows you to configure the palette (colors)

I did that, but it looked bad and besides, apps still ignore everything set by qt5ct, so...

Offline

#4 2023-04-03 13:09:45

seth
Member
Registered: 2012-09-03
Posts: 56,483

Re: [SOLVED] QT Apps completely ignore the theme

qBittorrent and KeepassXC, to be precise

qBittorrent uses Qt6, qt5ct won't do anything.
As for KeepassXC, you'll have to specify "bad" and "ignored" - what and how specifically?

Edit: does the qt5ct dialog itself look as you'd expect?

Last edited by seth (2023-04-03 13:10:22)

Offline

#5 2023-04-03 13:25:38

Dizzar
Member
Registered: 2023-04-03
Posts: 10

Re: [SOLVED] QT Apps completely ignore the theme

seth wrote:

qBittorrent and KeepassXC, to be precise

qBittorrent uses Qt6, qt5ct won't do anything.
As for KeepassXC, you'll have to specify "bad" and "ignored" - what and how specifically?

Edit: does the qt5ct dialog itself look as you'd expect?

So, KeepassXC ignores the theme completely, as in it looks the same no matter what theme settings I set. The same way it looks out of the box on, say, Windows or fresh KDE install.

When I say color palette method looked bad - I mean I didn't like how it looked at the time, but I didn't have adwaita installed and I think I just applied it to Fusion theme or something. I also didn't try it on real apps, just looked at the preview in qt5ct and went naaah. I maybe will delete my custom package and try to use a color palette instead.

qt5ct looks as I expect it to look - the theme is applied correctly.

Also, I had kvantum installed for some time, and when it was installed everything worked as expected, as in the kvantum theme was applied everywhere (but theming kvantum is too hard for me so I deleted it).

As for QT6, I had qt6ct installed for some time, but it didn't seem to help at all. I just reinstalled it now, applied the theme, but qBittorrent still looks the same.

Offline

#6 2023-04-03 13:36:50

seth
Member
Registered: 2012-09-03
Posts: 56,483

Re: [SOLVED] QT Apps completely ignore the theme

Please don't paraphrase, https://bbs.archlinux.org/viewtopic.php?id=57855

Applied *what* theme *where*
https://archlinux.org/packages/communit … waita-qt6/ ?

KeepassXC ignores the theme completely

likely means it uses some internal style or QML, in which case you won't change anything about that but patching it.
(The screenshots on their homepage somehwat suggest such)

Edit:
https://wiki.archlinux.org/title/Unifor … plications
And also try QT_STYLE_OVERRIDE=adwaita

Last edited by seth (2023-04-03 13:37:56)

Offline

#7 2023-04-03 14:14:48

Dizzar
Member
Registered: 2023-04-03
Posts: 10

Re: [SOLVED] QT Apps completely ignore the theme

seth wrote:

in which case you won't change anything about that but patching it.

Now that you mention that...

seth wrote:

And also try QT_STYLE_OVERRIDE=adwaita

I tried running apps (keepass in this instance but same goes for qbittorrent) like so:

-> % QT_STYLE_OVERRIDE=adwaita keepassxc
-> % QT_STYLE_OVERRIDE=adwaita-dark keepassxc
-> % QT_STYLE_OVERRIDE=fusion keepassxc
-> % QT_STYLE_OVERRIDE=windows keepassxc

And all produced the same result.

seth wrote:

Applied *what* theme *where*

Applied my modified adwaita in qt5ct and qt6ct, set env variables as seen in first post. Applying any other available theme in qt5ct and qt6ct (like Fusion) does not seem to work either.

After some investigation I found that my qt apps do, in fact, load the custom theme. Then they check my GTK theme, and choose the variant based on that. So, the moment I choose adwaita-dark as my GTK theme, qBittorrent suddenly starts using my theme and keepassxc shades itself dark (it seems it does, in fact, use built in qml). Other QT apps (I installed ark, kcalc and vlc for testing), as it turns out, worked all along, I just didn't have any.

After renaming my GTK theme with '-dark' suffix (and making a copy of 'gtk.css' called 'gtk-dark.css', dunno if it is actually required) everything now works as expected (even if the icons in qbittorrent are getting cropped on the sides)

Offline

#8 2023-04-03 17:34:05

StJimmy
Member
From: De Lage Landen
Registered: 2020-02-26
Posts: 71

Re: [SOLVED] QT Apps completely ignore the theme

Just as a heads-up: you can tell KeePassXC to use your platform theme by opening the 'View' menu, going into 'Theme' and selecting 'Classic (Platform-native)'.  It should then follow your preferred Qt5 style.


Nanos gigantum humeris insidentes.

Offline

Board footer

Powered by FluxBB