You are not logged in.

#76 2016-07-01 21:50:22

ANXHaruhi
Member
Registered: 2016-05-30
Posts: 18

Re: [SOLVED] Qt 5.7: Widget style GTK is not longer available

GSF1200S wrote:
ANXHaruhi wrote:
hpstg wrote:

Do you believe that something similar might be happening with Gnome? Unfortunately I don't have the expertise to look into the code, I wouldn't even know where to begin.

It may be. At the end of the day I don't know that much (in fact I am using linux seriusly for less than 2 months and the purpose of Arch was learn by doing), I just started pulling from the string "What happens if..." from the login screen until it appears on my screen."What happen if..." "... I use another DE?" It gets exported correctly and works. Let's see how exactly boots LXDE when I press the login button. "... I export the variables just before it starts executing the session?" The variables work, look further down the line. Time to look at the log for LXSession, "... I search for environment, QT and similar keywords, or files loaded through it?" No references, so the answer does have to lie inside LXSession, repeat again, download the sources and do a quick search inside the files with your tool of choice, and the answer appears.

The process should be something similar for GNOME. I don't know how GNOME works, but the logic steps for diagnose should apply pretty much here as well. Start by exporting it properly in your ~/.profile and ~/.pam_environment only, relog and check the output of "printenv | grep QT" in console as normal user. If it shows properly in console but it doesn't open correctly the app, or it doesn't open the app, something is overriding at login your config. Most certainly GNOME or unlikely some other program. To be sure, install something like Openbox, XFCE4 or MATE and boot into it, open a console and check the environment variables again. If it exports them properly it means that it is something specific that loads from GNOME, so you will have to find the login entry point and start cutting the login process in big logic segments. In each segment you will have to either use some relevant log that the desktop makes available or use a script to export the variables before or after the execution of a specific segment of the process until you get the chunk that doesn't load that variable. There will lie the root of the problem.

GSF1200S wrote:

In the interim you could just change the value to the one you need. I.e. grab lxsession from ABS, makepkg -o to get the sources, go in and change the hardcoded value to one that works for you, then makepkg -e. Then youd just need to pacman -U the built package. I do this to eliminate window hints from xfce4 terminal.

But yeah, that definitely shouldnt be hardcoded- should pull the value from /etc/environment at the very least.

Will do. First I need to learn what does involve doing everything in that process, but it should be interesting. And for my own good I should better learn how since it does seem that the fix will take a while to drop based on the amount of activity the bug tracker has.

Its real easy- ive pretty much already explained it smile First make sure ABS is installed (run as root or with sudo)[installs abs with pacman]:

pacman -S abs

Make sure ABS is updated (run as root or with sudo)[abs updates using rsync]:

abs

Then, use a file manager or cp to copy over the directory at /var/abs/community/lxsession (not as root)[cp -r recursively copies directories/files from the first path to the second path]:

cp -r /var/abs/community/lxsession ~/lxsession

Then open a terminal and change to that directory [changing directory to the ~/lxsession directory]:

cd ~/lxsession

Get the sources [download sources but do not build or do anything else with them]:

makepkg -o

Open up a file manager and navigate to the directory (its the directory 'lxsession' in your /home/user directory). Then navigate to the source directory in that directory, and navigate to the file you traced down to have the errant QT variable listed above. Open with a text editor, make your changes, save the file, and exit. Then go back to your terminal and build the package [build using existing sources]:

makepkg -e

Once the resulting lxsession tar.xz is built, install it with pacman:

pacman -U lxsession-whatever-version-is-made-here.tar.xz

Done.

So building a package was simpler and less painful than I though. I've finished doing it and it does work! I do feel accomplished, even if it is something as small and ridiculous as this. And for a change it does not feel like a black magic fix like those I'm used to apply in Windows. And for future reference for people coming next do note that in the original post I missed one of the two references, the second one being inside environment.vala same folder, in line 271. Thankfully I go with the premise that I am an idiot and I double check just in case. The more I learn, the more I feel it was the right decision to make the switch even if it is a pain from time to time.

Offline

#77 2016-07-02 16:32:42

hpstg
Member
Registered: 2007-06-09
Posts: 46

Re: [SOLVED] Qt 5.7: Widget style GTK is not longer available

It should be probably reported upstream, for both LXDE and Gnome. Gnome has the variable hardcoded too it seems.

Offline

#78 2016-07-02 19:57:52

gianluca.pettinello
Member
Registered: 2013-04-16
Posts: 72

Re: [SOLVED] Qt 5.7: Widget style GTK is not longer available

altermetax wrote:

Only working solution in Cinnamon to get GTK theme on Qt:
1) Install qt5-styleplugins or qt5-styleplugins-git
2) Install qt5ct
3) Set environment variable in /etc/environment QT_QPA_PLATFORMTHEME=qt5ct
4) Restart the system
5) Start qt5ct and select gtk2

Just doing QT_STYLE_OVERRIDE=gtk2 caused sigfaults with most Qt apps.
QT_STYLE_OVERRIDE=gtk3 makes Qt apps look horrible.

This worked for me. I'm in Xfce

Offline

#79 2016-07-02 22:10:54

hifi25nl
Member
Registered: 2011-05-07
Posts: 263

Re: [SOLVED] Qt 5.7: Widget style GTK is not longer available

5) Start qt5ct and select gtk2

I don't have gtk2 in qt5ct, only Breeze, Fusion, Windows  under Style

Offline

#80 2016-07-03 17:26:41

lmello
Member
From: Brazil
Registered: 2012-11-06
Posts: 300

Re: [SOLVED] Qt 5.7: Widget style GTK is not longer available

equeim wrote:

1. Install qt5-styleplugins and qt5ct
2. Place "export QT_QPA_PLATFORMTHEME=qt5ct" in ~/.bash_profile
3. Relogin
4. Configure Qt using qt5ct

This works for GNOME... but only for Qt applications called from the command line (bash)

My ~/.bash_profile is:

#
# ~/.bash_profile
#

[[ -f ~/.bashrc ]] && . ~/.bashrc

So I put placed export QT_QPA_PLATFORMTHEME=qt5ct in ~/.bashrc

Last edited by lmello (2016-07-03 17:35:49)


Fundamental Axiom of the Universe (aka Murphy's Law): Whatever can go wrong, will go wrong.
First Digital Deduction: Nothing obeys Murphy's Law so well as computers.
Second Digital Deduction: Everything go wrong at least once.
Third Digital Deduction: Things go wrong even when there's absolutely no possibility of anything go wrong.

Offline

#81 2016-07-04 22:41:18

lmello
Member
From: Brazil
Registered: 2012-11-06
Posts: 300

Re: [SOLVED] Qt 5.7: Widget style GTK is not longer available

Also, putting QT_QPA_PLATFORMTHEME=qt5ct in /etc/environment does not work under a gnome session.

I created an executable file named "qt5.sh" in /etc/profile.d containing:

export QT_QPA_PLATFORMTHEME=qt5ct

Then reset. When gdm showed up, I switched to another tty and logged in. The "env" command printed the environment variable QT_QPA_PLATFORMTHEME=qt5ct as expected. Then I logged in a gnome session, launched the terminal and the "env" command printed QT_QPA_PLATFORMTHEME=qgnomeplatform. So it seems gnome automatically overrides this variable. This worked with qt5 up untill 5.6.x. I don't know what to do.

Last edited by lmello (2016-07-04 23:43:29)


Fundamental Axiom of the Universe (aka Murphy's Law): Whatever can go wrong, will go wrong.
First Digital Deduction: Nothing obeys Murphy's Law so well as computers.
Second Digital Deduction: Everything go wrong at least once.
Third Digital Deduction: Things go wrong even when there's absolutely no possibility of anything go wrong.

Offline

#82 2016-07-04 23:41:37

ANXHaruhi
Member
Registered: 2016-05-30
Posts: 18

Re: [SOLVED] Qt 5.7: Widget style GTK is not longer available

I've pulled GNOME in my system to check about why it is not working, and it seems that it is not working by design, Arch Wiki confirms so. QT_QPA_PLATFORMTHEME=qgnomeplatform is the "default" on GNOME 3.20 and for what it seems they hardcoded the variable (at least based on it's behavior). I'll try to dig the code in the next days to see if it is the case, and if so to point where you can change it and recompile it, but seeing the rather long package list compared to the small and concise that LXDE has, no promises. And if I can find it and get it working I'll update the wiki.

Offline

#83 2016-07-04 23:49:36

lmello
Member
From: Brazil
Registered: 2012-11-06
Posts: 300

Re: [SOLVED] Qt 5.7: Widget style GTK is not longer available

ANXHaruhi wrote:

I've pulled GNOME in my system to check about why it is not working, and it seems that it is not working by design, Arch Wiki confirms so. QT_QPA_PLATFORMTHEME=qgnomeplatform is the "default" on GNOME 3.20 and for what it seems they hardcoded the variable (at least based on it's behavior). I'll try to dig the code in the next days to see if it is the case, and if so to point where you can change it and recompile it, but seeing the rather long package list compared to the small and concise that LXDE has, no promises. And if I can find it and get it working I'll update the wiki.

Yes, this design worked with qt5 < 5.7 automatically.

The folks at Qt said that gtk3 plugin won't be provided until 5.8.0.


Fundamental Axiom of the Universe (aka Murphy's Law): Whatever can go wrong, will go wrong.
First Digital Deduction: Nothing obeys Murphy's Law so well as computers.
Second Digital Deduction: Everything go wrong at least once.
Third Digital Deduction: Things go wrong even when there's absolutely no possibility of anything go wrong.

Offline

#84 2016-07-05 06:25:36

arojas
Developer
From: Spain
Registered: 2011-10-09
Posts: 2,151

Re: [SOLVED] Qt 5.7: Widget style GTK is not longer available

lmello wrote:

The folks at Qt said that gtk3 plugin won't be provided until 5.8.0.

That's not about the gtk style plugin, it's about shipping the gtk platform plugin (which we already ship) in their binary installer.

Offline

#85 2016-07-05 08:13:39

ANXHaruhi
Member
Registered: 2016-05-30
Posts: 18

Re: [SOLVED] Qt 5.7: Widget style GTK is not longer available

arojas wrote:
lmello wrote:

The folks at Qt said that gtk3 plugin won't be provided until 5.8.0.

That's not about the gtk style plugin, it's about shipping the gtk platform plugin (which we already ship) in their binary installer.

Not only that but (correct me if I'm wrong) that plugin still needs a style with support for both GTK and QT, so if you use a GTK theme without that support you either change to qt5ct or you are out of luck. Not everyone uses Adwaita. Which loops back to the primary issue, where instead of checking if the user declared it and, if so, use that value instead of forcing it by design does not seem that good of a design in the first place.

Offline

#86 2016-07-05 14:08:27

hpstg
Member
Registered: 2007-06-09
Posts: 46

Re: [SOLVED] Qt 5.7: Widget style GTK is not longer available

Shouldn't this be reported upstream for Gnome? Isn't it bad design to hardcode environmental variables?

Offline

#87 2016-07-06 03:35:56

lmello
Member
From: Brazil
Registered: 2012-11-06
Posts: 300

Re: [SOLVED] Qt 5.7: Widget style GTK is not longer available

hpstg wrote:

Shouldn't this be reported upstream for Gnome? Isn't it bad design to hardcode environmental variables?

Perhaps. I don't know how qgnomeplatform works but they do need to talk with the Qt developers about it to provide a simple solution from now on... QGtkStyle was basically "plug and play" with Qt applications running on GTK+ based desktop environments up until recently.


Fundamental Axiom of the Universe (aka Murphy's Law): Whatever can go wrong, will go wrong.
First Digital Deduction: Nothing obeys Murphy's Law so well as computers.
Second Digital Deduction: Everything go wrong at least once.
Third Digital Deduction: Things go wrong even when there's absolutely no possibility of anything go wrong.

Offline

#88 2016-07-06 07:35:41

jungy
Member
Registered: 2016-07-06
Posts: 1

Re: [SOLVED] Qt 5.7: Widget style GTK is not longer available

I found the 'bug' in gnome-session. And it seems to be fixed in version 3.21.3

In gnome-session-3.20.1/gnome-session/main.c, line 418:

gsm_util_setenv ("QT_QPA_PLATFORMTHEME", "qgnomeplatform");

In gnome-session-3.21.3/gnome-session/main.c, line 420-422:

if (g_getenv ("QT_QPA_PLATFORMTHEME") == NULL) {
        gsm_util_setenv ("QT_QPA_PLATFORMTHEME", "qgnomeplatform");
}

If you want to fix the problem before getting official update, you can try it:
https://download.gnome.org/core/3.21/3. … 1.3.tar.xz

Last edited by jungy (2016-07-06 08:10:51)

Offline

#89 2016-07-06 19:52:55

ANXHaruhi
Member
Registered: 2016-05-30
Posts: 18

Re: [SOLVED] Qt 5.7: Widget style GTK is not longer available

jungy wrote:

I found the 'bug' in gnome-session. And it seems to be fixed in version 3.21.3

In gnome-session-3.20.1/gnome-session/main.c, line 418:

gsm_util_setenv ("QT_QPA_PLATFORMTHEME", "qgnomeplatform");

In gnome-session-3.21.3/gnome-session/main.c, line 420-422:

if (g_getenv ("QT_QPA_PLATFORMTHEME") == NULL) {
        gsm_util_setenv ("QT_QPA_PLATFORMTHEME", "qgnomeplatform");
}

If you want to fix the problem before getting official update, you can try it:
https://download.gnome.org/core/3.21/3. … 1.3.tar.xz

Thanks! With that maybe I can figure out what is needed for proper checking in LXDE and even submitting a patch.

Offline

#90 2016-07-07 00:21:44

lmello
Member
From: Brazil
Registered: 2012-11-06
Posts: 300

Re: [SOLVED] Qt 5.7: Widget style GTK is not longer available

jungy wrote:

I found the 'bug' in gnome-session. And it seems to be fixed in version 3.21.3

In gnome-session-3.20.1/gnome-session/main.c, line 418:

gsm_util_setenv ("QT_QPA_PLATFORMTHEME", "qgnomeplatform");

In gnome-session-3.21.3/gnome-session/main.c, line 420-422:

if (g_getenv ("QT_QPA_PLATFORMTHEME") == NULL) {
        gsm_util_setenv ("QT_QPA_PLATFORMTHEME", "qgnomeplatform");
}

If you want to fix the problem before getting official update, you can try it:
https://download.gnome.org/core/3.21/3. … 1.3.tar.xz

That's a simple patch - I'll send it to the bugtracker


Fundamental Axiom of the Universe (aka Murphy's Law): Whatever can go wrong, will go wrong.
First Digital Deduction: Nothing obeys Murphy's Law so well as computers.
Second Digital Deduction: Everything go wrong at least once.
Third Digital Deduction: Things go wrong even when there's absolutely no possibility of anything go wrong.

Offline

#91 2016-07-07 01:54:30

lmello
Member
From: Brazil
Registered: 2012-11-06
Posts: 300

Re: [SOLVED] Qt 5.7: Widget style GTK is not longer available

lmello wrote:
jungy wrote:

I found the 'bug' in gnome-session. And it seems to be fixed in version 3.21.3

In gnome-session-3.20.1/gnome-session/main.c, line 418:

gsm_util_setenv ("QT_QPA_PLATFORMTHEME", "qgnomeplatform");

In gnome-session-3.21.3/gnome-session/main.c, line 420-422:

if (g_getenv ("QT_QPA_PLATFORMTHEME") == NULL) {
        gsm_util_setenv ("QT_QPA_PLATFORMTHEME", "qgnomeplatform");
}

If you want to fix the problem before getting official update, you can try it:
https://download.gnome.org/core/3.21/3. … 1.3.tar.xz

That's a simple patch - I'll send it to the bugtracker

I discussing this in Manjaro and Phil was quicker smile https://github.com/manjaro/release-plan … -230720490 so I sent the tree instead.

Last edited by lmello (2016-07-07 01:54:59)


Fundamental Axiom of the Universe (aka Murphy's Law): Whatever can go wrong, will go wrong.
First Digital Deduction: Nothing obeys Murphy's Law so well as computers.
Second Digital Deduction: Everything go wrong at least once.
Third Digital Deduction: Things go wrong even when there's absolutely no possibility of anything go wrong.

Offline

#92 2016-07-12 19:57:36

hpstg
Member
Registered: 2007-06-09
Posts: 46

Re: [SOLVED] Qt 5.7: Widget style GTK is not longer available

Thank you so much guys! This thread is an example why open source is the way to go! smile

Offline

#93 2016-07-16 10:55:42

marmistrz
Member
Registered: 2016-01-05
Posts: 122

Re: [SOLVED] Qt 5.7: Widget style GTK is not longer available

Currently the Qt apps don't look that bad for me. Previously I played with qt5ct a little and I chose some theme, which broke the theming even more. So I cleaned my config (removed most ~/.* from my home folder), most apps look correct (such as texmaker)

Only virtualbox follows the problematic style
https://imgur.com/p2Xm6aQ

What can I do with it?

Offline

#94 2016-07-16 10:58:17

ANXHaruhi
Member
Registered: 2016-05-30
Posts: 18

Re: [SOLVED] Qt 5.7: Widget style GTK is not longer available

marmistrz wrote:

Currently the Qt apps don't look that bad for me. Previously I played with qt5ct a little and I chose some theme, which broke the theming even more. So I cleaned my config (removed most ~/.* from my home folder), most apps look correct (such as texmaker)

Only virtualbox follows the problematic style
https://imgur.com/p2Xm6aQ

What can I do with it?

Virtualbox uses qt4 AFAIK, use qtconfig-qt4 for changing Virtualbox theming.

Offline

#95 2016-07-16 11:53:22

xduugu
Member
Registered: 2008-10-16
Posts: 292

Re: [SOLVED] Qt 5.7: Widget style GTK is not longer available

Virtualbox 5.1 uses Qt5, but I see no difference to other Qt5 applications.

Offline

#96 2016-07-16 13:33:18

ANXHaruhi
Member
Registered: 2016-05-30
Posts: 18

Re: [SOLVED] Qt 5.7: Widget style GTK is not longer available

xduugu wrote:

Virtualbox 5.1 uses Qt5, but I see no difference to other Qt5 applications.

Oh it just updated, I'm quite sure that 5.0 still used qt4. Then disregard my advice and update virtualbox marmistrz.

Offline

#97 2016-07-17 09:17:17

marmistrz
Member
Registered: 2016-01-05
Posts: 122

Re: [SOLVED] Qt 5.7: Widget style GTK is not longer available

Using virtualbox 5.1.0-1.

And virtualbox looks the same even if I use QT_STYLE_OVERRIDE=clearlooks. And this happens as a new user too.

I removed qt5-styleplugins: virtualbox is usable. Installed it back - the problem comes back.

Last edited by marmistrz (2016-07-17 09:25:05)

Offline

#98 2016-09-05 05:13:26

edgardcastro
Member
Registered: 2016-09-05
Posts: 1

Re: [SOLVED] Qt 5.7: Widget style GTK is not longer available

altermetax solution is what worked for me for 100% of the qt5 apps. thanks!

Last edited by edgardcastro (2016-09-05 05:15:45)

Offline

#99 2016-09-15 07:55:31

xduugu
Member
Registered: 2008-10-16
Posts: 292

Re: [SOLVED] Qt 5.7: Widget style GTK is not longer available

The latest commit added the gtk2 platform theme, so it is now possible to to use

QT_QPA_PLATFORMTHEME=gtk2

Offline

#100 2016-09-15 14:24:34

masolit
Member
Registered: 2013-12-24
Posts: 46

Re: [SOLVED] Qt 5.7: Widget style GTK is not longer available

yaourt qt5gtk2

Add line 'export QT_QPA_PLATFORMTHEME=qt5gtk2' to ~/.profile and re-login.

Last edited by masolit (2016-09-15 14:27:10)

Offline

Board footer

Powered by FluxBB