Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
5.15.2
-
None
-
Ubuntu 20.04 LTS
Description
Hi. I'm not sure whether I logged this bug on the right targets; I'm on Ubuntu 20.04 LTS, which I guess uses Gnome by default, but Linux/Gnome wasn't a choice so I picked "Linux/Other display system". And I'm not sure "Widgets: Styles" is right either, sorry.
Here's the problem. I'm trying to get my Qt app to run with a "dark mode" theme. First I tried using Gnome's "tweaks" app to simply change to a dark theme, and that worked for the system overall – but apparently Qt apps ignore that setting. That's the fundamental problem that I intend this bug to apply to: Ubuntu is a very mainstream platform, and Gnome is the windowing system it uses out of the box, and it seems odd/surprising that Qt just ignores the user's theme setting in that environment (unless I'm doing something wrong, perhaps).
After some head-scratching, I found this article: https://frontpagelinux.com/tutorials/qt-theming-on-ubuntu-and-other-gnome-desktops/. It seems to confirm that Qt apps ignore the user's theme in Gnome, and it provides a workaround involving installing something called Kvantum that can provide a dark theme to Qt apps. This sounded great, so I went through the steps described and got it installed. Now, however, when I run my app, I get an error at startup:
QApplication: invalid style override 'kvantum' passed, ignoring it.
Available styles: Windows, Fusion
I have no idea why this happens; I think I followed the steps correctly. So I'm pretty much at my wit's end. I just want to do this in order to test that my app's "dark mode" support (which I just added for macOS, and it works great on that platform) also works properly on Linux. But if I can't figure out how to get my app to run with a dark theme on Linux, then I'm unable to test this feature. :-< So, if you know how to get my app to run with a dark theme on Ubuntu 20.04, I'd appreciate that info; but in any case, after beating my head against the wall for half a day on this, it seems to me that Qt needs better support for the user's chosen theme on this platform. Thanks!
Attachments
Issue Links
- relates to
-
QTBUG-93955 Material.System does not work on Ubuntu (Gnome)
- Closed
For Gerrit Dashboard: QTBUG-90504 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
428068,4 | Account for dark system themes in qt_fusionPalette | dev | qt/qtbase | Status: MERGED | +2 | 0 |
428541,2 | Account for dark system themes in qt_fusionPalette | 6.4 | qt/qtbase | Status: MERGED | +2 | 0 |
428588,2 | qt_fusionPalette: make links more legible on dark backgrounds | dev | qt/qtbase | Status: MERGED | +2 | 0 |
428748,2 | qt_fusionPalette: make links more legible on dark backgrounds | 6.4 | qt/qtbase | Status: MERGED | +2 | 0 |