Bugzilla – Bug 1002900
Qt5 doesn't obey GTK+ theming, possibly missing qtstyleplugins
Last modified: 2020-12-03 13:55:10 UTC
Hello, with the upgrade to QT 5.7.0 my QT5 apps no longer obey the GTK theme. I always used to use `QT_STYLE_OVERRIDE=gtk` in my `/etc/environment` file, and it worked fine. Now it appears this might not be supported anymore, but openSUSE appears to be missing the `qtstyleplugins` that is now needed? These are the references I can find about the issue: https://github.com/linuxmint/Cinnamon/issues/5440 https://wiki.archlinux.org/index.php/Qt#Qt5 > To force a specific style, you can set the QT_STYLE_OVERRIDE environment variable. Specifically, set it to gtk2 if you want to use the GTK+ theme (Note: you will need to install the Qt style plugins mention below to get the GTK+ style) https://aur.archlinux.org/packages/qt5-styleplugins/
It is 'needed' for using gtk2 style, yes, as the style has been removed from official Qt base module. As you noticed maybe, for Arch the package is in AUR repo -> perfect example for someone to package it in OBS =) I don't want to maintain it. Last, and only release (w/o gtk2 style) is 3 years old.
Hi Hrvoje, thanks for the reply, although that wasn't exactly the answer I wanted to hear. :-) So there's no more options to make QT5 apps look decent?
Alexei, could you please take a look at this? Would it be possible to apply Clem's patch so that Cinnamon doesn't force the now useless `QT_STYLE_OVERRIDE` variable? https://github.com/linuxmint/Cinnamon/issues/5440#issuecomment-250939396
I haven't looked at the whole cinnamon-session/main.c, but the patch seems hammer-like. IMHO best solution in Qt-language would be e.g. #if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) if (qEnvironmentVariableIsEmpty("QT_STYLE_OVERRIDE")) { qputenv("QT_STYLE_OVERRIDE", QByteArray("gtk")); } #endif
I have some ideas about fixing this mess. Might take a while sorting it all out though.
Hi Alexei, thanks a lot for taking a look. This is indeed a mess, but caused by the Qt project. Meanwhile, I am using the `qt5ct` package with the Fusion theme and a color scheme that approximately matches what my GTK theme has. I am attaching it for reference. This makes my system somewhat more bearable to use for now.
Created attachment 696586 [details] ~/.config/qt5ct for regular user accounts
Created attachment 696587 [details] /root/.config/qt5ct also needs to be in place for themed YaST2
Created attachment 696588 [details] I prefer the color definitions to be in a common /usr/share/qt5ct location
I've created https://build.opensuse.org/request/show/436689 to make sure everybody gets libqt5-qtstyleplugins-platformtheme-gtk2 finally solving this issue :-).
Well done Alexei, thanks a lot!
This is an autogenerated message for OBS integration: This bug (1002900) was mentioned in https://build.opensuse.org/request/show/537327 Factory / libqt5-qtbase