Artix Linux Forum

Artix Linux => Applications & Software => Topic started by: brandflake11 on 25 March 2021, 13:53:13

Title: [SOLVED] Qt6 Gui Broken on Artix runit Mate
Post by: brandflake11 on 25 March 2021, 13:53:13
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:

Code: [Select]
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.
Title: Re: Qt6 Gui Broken on Artix runit Mate
Post by: alium on 25 March 2021, 15:05:17
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
Title: Re: Qt6 Gui Broken on Artix runit Mate
Post by: brandflake11 on 25 March 2021, 15:44:07
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).
Title: Re: Qt6 Gui Broken on Artix runit Mate
Post by: alium on 25 March 2021, 17:12:46
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 ?
Title: Re: Qt6 Gui Broken on Artix runit Mate
Post by: brandflake11 on 25 March 2021, 18:05:20
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?
Title: Re: Qt6 Gui Broken on Artix runit Mate
Post by: alium on 25 March 2021, 19:06:00
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
Title: Re: Qt6 Gui Broken on Artix runit Mate
Post by: brandflake11 on 26 March 2021, 13:24:42
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?
Title: Re: Qt6 Gui Broken on Artix runit Mate
Post by: linuxer on 26 March 2021, 18:33:26
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.
Title: Re: Qt6 Gui Broken on Artix runit Mate
Post by: brandflake11 on 26 March 2021, 20:35:04
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:
Code: [Select]
QT_QPA_PLATFORMTHEME=qt6gtk2
#QT_QPA_PLATFORMTHEME=gtk2
#QT_STYLE_OVERRIDE=gtk
Title: Re: Qt6 Gui Broken on Artix runit Mate
Post by: linuxer on 26 March 2021, 21:44:05

Is incorrect, so change it to:
Code: [Select]
QT_QPA_PLATFORMTHEME=qt5ct

or to:
Code: [Select]
QT_QPA_PLATFORMTHEME=qt6ct
Title: Re: Qt6 Gui Broken on Artix runit Mate
Post by: brandflake11 on 29 March 2021, 04:44:34
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!
Title: Re: Qt6 Gui Broken on Artix runit Mate
Post by: brandflake11 on 29 March 2021, 14:29:31
Is incorrect, so change it to:
Code: [Select]
QT_QPA_PLATFORMTHEME=qt5ct

or to:
Code: [Select]
QT_QPA_PLATFORMTHEME=qt6ct

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:

Quote
Add line 'export QT_QPA_PLATFORMTHEME=qt6gtk2' to ~/.profile and re-login.
Alternatively, create the file /etc/X11/Xsession.d/100-qt6gtk2 with
the following line:

export QT_QPA_PLATFORMTHEME=qt6gtk2
Title: Re: Qt6 Gui Broken on Artix runit Mate
Post by: linuxer on 29 March 2021, 16:40:56
Yup, but on this way, you have to change any theme by hand, and not by qt5ct or qt6ct.


have fun ;)
Title: Re: Qt6 Gui Broken on Artix runit Mate
Post by: brandflake11 on 29 March 2021, 16:53:24
That makes more sense, thanks!