Score:0

QT6 strange widget rendering when 'XDG_CURRENT_DESKTOP' is defined

US flag

~~(Note: This question was originally asked on QT's forum, without much help)~~

We recently upgraded to Ubutnu 22.04, with QT 6.5.1 installed using the online installer. When porting some of our older (QT <= 5) apps, I noticed a strange issue with buttons, and progress bars, (so far).

In the designer, when I add a new button or progress bar, this is what I get (After further testing, it's not only limited to button and progress bar. Several widgets are also affected).

When I run the app, this is what I get

Here's the real kicker, this is what happens when I resize/move the window

After posting the original question, I tried messing with the environment variables. I found two culprits

GNOME_DESKTOP_SESSION_ID=this-is-deprecated

XDG_CURRENT_DESKTOP=ubuntu:GNOME

Running in an empty environment with env -i ..., and only specifying the DISPLAY variable without anything else, or even only just disabling these two in the IDE I'm using, I got the correct/expected behavior, the widgets/window looked identical to the preview in the designer.

Unfortunately, I can't unset XDG_CURRENT_DESKTOP in .profile "easily" without completely breaking my desktop environment, so that's a no-go.

Any help is very appreciated

HuHa avatar
es flag
Try different widget themes and/or style sheets. Use your desktop's widget theme selector for starters. And no, you definitely never want to mess with a user's environment such as `XDG_CURRENT_DESKTOP`; that is for the user to decide, not an application.
Score:0
US flag

Downgrading from QT6.5.2 to QT6.4.3 solved the issue

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.