Hello all,
It seems that with the introduction of qt6, all programs that use qt6 are broken. For me, this includes qsynth, qjackctl, qtractor, and cmake-gui. When running these applications from the shell, this is the error that is printed to me:
QApplication: invalid style override 'gtk' passed, ignoring it.
Available styles: qt6ct-style, Windows, Fusion
Here is what qsynth looks like:
(http://bthale.com/wp-content/uploads/2021/03/qt6-broken.png)
What can I do about fixing this? These applications are all unusable.
install qt6ct and set properly your qt6/gtk themes.
https://wiki.archlinux.org/index.php/Qt
for qt6 exist probably no gtk2 support, you need probably install https://aur.archlinux.org/packages/qt6gtk2
Okay, I have gone to /etc/environment and commented out QT_STYLE_OVERRIDE and set QT_QPA_PLATFORMTHEME=qt6gtk2 after installing it from the aur. I still have mangled qt6 windows (although now they are the same colors as my system). Is there anywhere else I need to check to unmangle qt6? I would try to play with qt6ct, but it is also mangled like in the image.
As a side issue, setting QT_QPA_PLATFORMTHEME=qt6gtk2 removes qt5's styling (although this is not a big issue as the applications are still usable).
I don't think some of the developers bothered some dead gtk2. So probably nothing like qt6-styleplugins will be realised.
However, because qt6 is still not ready (certainly not 6.0.x), the situation may improve over time. however, since it is planned to remove gtk2 (not only from archlinux), gtk2 support by another toolkits will probably not be much better ...
did you try QT_QPA_PLATFORMTHEME=qt6ct ?
I just tried setting QT_QPA_PLATFORMTHEME=qt6ct. With this, the theme is back to a "stock" qt theme (the very bright white theme), but the gui is still garbled. I think the issue doesn't have to do with the variables.
Is there a good way to say get rid of qt configs to see if that is causing the issue? Also, does qt6 share configs with qt5 at all?
good question... i read qt6 API is diferent as qt5 API, so hard to say, what was exactly rewritten. see https://archlinux.org/packages/extra/x86_64/qt6-5compat/ they put old qt5 api's to on one's own package
Hmmm, I'm a little stumped as to what to do. I will try to see if removing config files will fix the gui, but if anyone else knows any better suggestion, I will gladly take it. Maybe the best thing to do would be reach out to qt6 folks?
QT_QPA_PLATFORMTHEME=qt5ct works with qt6ct and the qt6gtk2 (https://aur.archlinux.org/packages/qt6gtk2) AUR package as below:
(https://imgur.com/5P8V2Uh.png)
kvantum does not seem to be supported yet.
That's good to know for keeping themes across qt5 and qt6.
Unfortunately, it seems my problem is not related to these variables. I'll keep this in mind, once I fix qt6 to keep theming correct. Currently, this is what qt6ct looks like:
(http://bthale.com/wp-content/uploads/2021/03/qt6ct-not-working.png)
Here is what my environment variables look like in /etc/environment:
QT_QPA_PLATFORMTHEME=qt6gtk2
#QT_QPA_PLATFORMTHEME=gtk2
#QT_STYLE_OVERRIDE=gtk
Is incorrect, so change it to:
QT_QPA_PLATFORMTHEME=qt5ct
or to:
QT_QPA_PLATFORMTHEME=qt6ct
Thank you, I will change the environment variable.
However, I found what the issue was that was causing the broken qt6 problem.
Mate desktop has an auto hidpi scaling feature that was causing certain applications (qt6 and obs) to render incorrectly when using the nvidia card output. To fix it, I used mate-tweak, and adjusted the hidpi from Auto-Detect, to Regular, and it fixed the guis. This also resizes gtk correctly, as for some reason it was slightly smaller.
It was not a qt environment variable at all, but mate was causing it! Thank you all for your help on this and teaching me about qt environment variables!
Although this is unrelated to the issue, I just wanted to post this from the github page of qt6gtk2 (https://github.com/trialuser02/qt6gtk2). They actually recommend to export that variable, which is where I got it from. It does theme your qt6 applications, so it did work for me:
Yup, but on this way, you have to change any theme by hand, and not by qt5ct or qt6ct.
have fun ;)
That makes more sense, thanks!