Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] QT_STYLE_OVERRIDE is not effective
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
lilrc
n00b
n00b


Joined: 23 Sep 2012
Posts: 19
Location: Sweden

PostPosted: Sat May 02, 2015 7:30 am    Post subject: [SOLVED] QT_STYLE_OVERRIDE is not effective Reply with quote

When I run pcmanfm-qt the default gtkstyle theme from qt4 is not used. If I do this
Code:
pcmanfm-qt -style gtk

the gtkstyle theme is used as expected, but if I do this (as suggested by [1])
Code:
QT_STYLE_OVERRIDE=gtk pcmanfm-qt

gtkstyle is not used.

What am I doing wrong?

[1] http://doc.qt.io/qt-5/qapplication.html#QApplication


Last edited by lilrc on Sat May 02, 2015 3:13 pm; edited 1 time in total
Back to top
View user's profile Send private message
franzf
Advocate
Advocate


Joined: 29 Mar 2005
Posts: 4408

PostPosted: Sat May 02, 2015 8:28 am    Post subject: Reply with quote

You are doing everything right, it's pcmanfm-qt. They use a proxy style. QApplication only parses the cmdline, pcmanfm handles the style. But noone parses (in this configuration) the environment for QT_STYLE_OVERRIDE.
A possible solution is here:
https://github.com/QupZilla/qupzilla/commit/7a1f4c77cd228ac1cbe13288d6a17abace3b12f2
Requires a bug report to pcmanfm-qt (https://github.com/lxde/pcmanfm-qt)
Back to top
View user's profile Send private message
lilrc
n00b
n00b


Joined: 23 Sep 2012
Posts: 19
Location: Sweden

PostPosted: Sat May 02, 2015 12:19 pm    Post subject: Reply with quote

Ah, thank you for your quick and informative answer! Is there another way to set the preferred QT5 style for all applications? Otherwise I will have to file a bug upstream.
Back to top
View user's profile Send private message
franzf
Advocate
Advocate


Joined: 29 Mar 2005
Posts: 4408

PostPosted: Sat May 02, 2015 2:24 pm    Post subject: Reply with quote

Could you test this workaround:
Create a file ~/.config/kdeglobals with the following content:
Code:
[KDE]
widgetStyle=gtk

Then do
Code:
export QT_QPA_PLATFORMTHEME=kde

and pcmanfm-qt runs with the gtk theme.
There is that one downside: You have to save your theme in a config file instead of directly exporting it... (and remember it's a kde config file...)
Back to top
View user's profile Send private message
lilrc
n00b
n00b


Joined: 23 Sep 2012
Posts: 19
Location: Sweden

PostPosted: Sat May 02, 2015 2:53 pm    Post subject: Reply with quote

franzf wrote:
Could you test this workaround:
Create a file ~/.config/kdeglobals with the following content:
Code:
[KDE]
widgetStyle=gtk

Then do
Code:
export QT_QPA_PLATFORMTHEME=kde

and pcmanfm-qt runs with the gtk theme.
There is that one downside: You have to save your theme in a config file instead of directly exporting it... (and remember it's a kde config file...)

Unfortunately that does not work.
Back to top
View user's profile Send private message
lilrc
n00b
n00b


Joined: 23 Sep 2012
Posts: 19
Location: Sweden

PostPosted: Sat May 02, 2015 3:12 pm    Post subject: [SOLVED] QT_STYLE_OVERRIDE is not effective Reply with quote

I found it!
Code:
export QT_QPA_PLATFORMTHEME=gtk2

did the trick! Thank you for your help pointing me to that variable! :D
Back to top
View user's profile Send private message
kenny_w
Tux's lil' helper
Tux's lil' helper


Joined: 26 Nov 2017
Posts: 83
Location: Toronto, Canada

PostPosted: Fri Dec 15, 2017 1:50 am    Post subject: Reply with quote

Hey guys how would I do this on LXDE? I'm really sorry to necro-bump an old-ish post but I'm really stumped, I've added an /etc/environment and /etc/profile.d/qt5ct.sh entries but it still won't work. I'm trying to set qt5ct so I can config it with a GUI, but I always set it to gtk2.

I tried making an entry like you guys said but it still tells me the environment variable isn't set... this is starting to really feel hopeless :(

edit: I've given up, so don't bother trying to help. nevermind. sorry.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum