catppuccin / nix

❄️ Soothing pastel theme for Nix

Home Page:https://nix.catppuccin.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Qt] Setting QT_STYLE_OVERRIDE breaks QML apps

TheSunCat opened this issue · comments

Super happy to see Qt support added to this flake! I just upgraded to it and dramatically simplified my theme config as the Qt part is now handled by Catppuccin. However, I noticed it requires setting QT_STYLE_OVERRIDE to kvantum for it to work. When this variable is set, QML apps fail to run entirely.
For example, nheko (the Matrix client) opens a blank gray window and prints this message:

[2024-07-12 21:47:46.384] [qml] [warning] qrc:/resources/qml/Root.qml: module "kvantum" is not installed (qrc:/resources/qml/Root.qml:-1, )

Unsetting QT_STYLE_OVERRIDE manually in that shell allows nheko to start normally, but obviously the Catppuccin style is no longer applied.

commented

See #275 (comment) for some more context, but to put it simply: I really don't know much about Qt theming, so help here would be greatly appreciated

It seems home-manager is the one setting this upstream whenever qt.style.name is set. I'm not sure how to work around this -- the best idea I've found is in this reddit comment:

You have to unset $QT_STYLE_OVERRIDE and replace it with $QT_QPA_PLATFORM=qt6ct then change the style in qt6ct to kvantum, this fixed my theming and crashes

Seems this could be related to #275

commented

have you set qt.platformTheme.name to kvantum?

Thanks for looking into this. Since making this issue, I've moved to using the Catppuccin qt6ct theme directly instead of Kvantum, and got it mostly working. Some KDE apps are still borked, but nheko and other apps I use at least launch. This is the theme config I have: https://git.allpurposem.at/mat/Computer/src/branch/main/hm/modules/theme.nix#L57-L81