Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Qt] Setting QT_STYLE_OVERRIDE breaks QML apps #288

Open
TheSunCat opened this issue Jul 12, 2024 · 3 comments
Open

[Qt] Setting QT_STYLE_OVERRIDE breaks QML apps #288

TheSunCat opened this issue Jul 12, 2024 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@TheSunCat
Copy link

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.

@getchoo getchoo added bug Something isn't working help wanted Extra attention is needed labels Sep 21, 2024
@getchoo
Copy link
Member

getchoo commented Sep 21, 2024

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

@zspher
Copy link
Contributor

zspher commented Sep 22, 2024

have you set qt.platformTheme.name to kvantum?

@TheSunCat
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants