How to theme qt6 apps?

I have set up dark-theme for qt applications like this:

qt = {
enable = true;
style = "adwaita-dark";
};

And it works for qt5 applications, but when I try qt6 applications, the dark theme is not picked up and I get these errors in the terminal:

qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
QApplication: invalid style override 'adwaita-dark' passed, ignoring it.
Available styles: Windows, Fusion

This is the same for every qt6 application I tried, but if you want to test it you can try the program NanoVNASaver which is light and fast to install.

Is anyone able to set dark theme on qt6 applications on NixOS? How do you do it? Do you think it is a problem in the qt6 package used to build all these applications?

2 Likes

Exact same issue here. Calibre for example. Also i made the most simple qt6 demo app with blank screen, and still same error.

So in the end it was my fault apparently. Now I have the same qt theming configuration I provided in the question and it is working.

Just make sure that the version of the qt library used to build your system configuration is the same as the one used to build the application.

For example, in my case I was building the application from a local outdated copy of nixpkgs, make sure that you are installing the program directly from your configuration and make sure your system is up to date.