Page 1 of 1

QT5CT environment variable not set

Posted: Tue Jan 30, 2018 1:01 pm
by kyle_a
Hey guys n gals, I'm wondering how to set QT5CT as the main configuration tool for QT5 apps - when I run qt5ct from the terminal it will open up no problem, but when I try to open it from the menu it won't allow it & tells me the environment variable isn't set. "The QT_QPA_PLATFORMTHEME environment variable is not set correctly"

I'm using the LXDE desktop.
/etc/environment looks like:
BROWSER=/usr/bin/xdg-open
QT_QPA_PLATFORMTHEME=qt5ct

& /etc/profile.d/qt5ct.sh looks like:
export QT_QPA_PLATFORMTHEME=qt5ct

This normally works on basic Debian installations. Why isn't this working here though? It'll work if I open up qt5ct & qt5 apps from the terminal, but it won't work from the menu.... What am I missing?

Re: QT5CT environment variable not set

Posted: Tue Jan 30, 2018 1:35 pm
by dolphin_oracle
there is a file in /etc/X11/Xsession.d/ that controls the QT5CT environment variable.

Re: QT5CT environment variable not set

Posted: Tue Jan 30, 2018 2:56 pm
by Stevo
You can run it from the terminal with this, too:

Code: Select all

export QT_QPA_PLATFORMTHEME=qt5ct && qt5ct
You should be able to modify the launch command in the menu to also export that to the environment first, if you don't want to edit the /etc/X11/Xsession.d/98qtconfig file.

Did you mean LXQT instead of LXDE?

I also see there's a newer version in upstream Debian...I'll build that and see how it works out of the box.

Re: QT5CT environment variable not set

Posted: Tue Jan 30, 2018 4:03 pm
by Stevo
The new qt5ct still needed the environment variable command to run the first time, but after I changed the theme selection, it would start normally. But changing the theme in qt5ct had no effect on other Qt 5 apps. I think that the 98qtconfig file is still in charge, and you will have to change "gtk2" in that to "qt5ct", or move the file out of that folder altogether for LXQT.

Re: QT5CT environment variable not set

Posted: Tue Jan 30, 2018 5:30 pm
by kyle_a
Stevo wrote:You can run it from the terminal with this, too:

Code: Select all

export QT_QPA_PLATFORMTHEME=qt5ct && qt5ct
You should be able to modify the launch command in the menu to also export that to the environment first, if you don't want to edit the /etc/X11/Xsession.d/98qtconfig file.

Did you mean LXQT instead of LXDE?

I also see there's a newer version in upstream Debian...I'll build that and see how it works out of the box.

No, I said LXDE. I don't like LXQT at all. Not a fan! Its full of bugs & things won't work the way I want them to, plus the GUI configuration windows are such a mess. Strongly dislike LXQT & will be even more mad if distros try to replace LXDE with LXQT. With LXDE I can just use QT5CT & it will look like my GTK2 / 3 stuff, that's the way I like it.

I've used that command - it doesn't make things from the menu change though!! Only things that are launched from the terminal will work with QT5CT properly! Why is the menu different?
Just try changing the icons & then open up a web browser or something from the menu & you'll see the icons aren't changing.

Re: QT5CT environment variable not set

Posted: Tue Jan 30, 2018 5:33 pm
by richb
I am going to move this thread to MX Modified as it pertains to lXDE not the default XFCE.

Re: QT5CT environment variable not set

Posted: Tue Jan 30, 2018 5:36 pm
by kyle_a
Stevo wrote: You should be able to modify the launch command in the menu to also export that to the environment first, if you don't want to edit the /etc/X11/Xsession.d/98qtconfig file.
How would I modify it? What would that look like?
I've installed AntiX & that file doesn't exist(but neither does this problem), but I am making note of it in case for some reason I end up back on MX or Debian.
Thanks.

Re: QT5CT environment variable not set

Posted: Tue Jan 30, 2018 6:00 pm
by Stevo
We ship the 98qtconfig file with MX so that Qt 5 applications automatically follow the XFCE gtk themes. This makes everything have the same themes without qt5ct. It seems you want the same setup in LXDE, so it should work the same way as in MX. LXDE is GTK, so without that file, qt5ct is only going to affect qt5 applications, and LXDE will go on its merry way if you don't set it to gtk2.