You are not logged in.

#1 2016-04-19 08:12:25

baihou
Member
Registered: 2016-04-19
Posts: 9

[SOLVED] Qt5 applications in Gnome 3.20

Hello, guys. I have a problem with making Qt5 apps to follow qt5ct theme. I have this line in my .profile

export QT_QPA_PLATFORMTHEME=qt5ct

and before Gnome 3.20 it worked like a charm, but after upgrade Qt5 apps use Gtk theme. I belive it has something with this "bugfix", but I don't want to tell Qt applications to look like Gnome. I still can run Qt5 apps from terminal and they follow qt5ct theme, but not if I'm running them from menu or through Alt+F2.
So how can I override this?

Last edited by baihou (2016-05-02 18:11:08)

Offline

#2 2016-04-19 08:42:17

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

Re: [SOLVED] Qt5 applications in Gnome 3.20

This commit should fix it, but I see they haven't backported it to the 3.20 branch.

Offline

#3 2016-04-19 08:52:57

baihou
Member
Registered: 2016-04-19
Posts: 9

Re: [SOLVED] Qt5 applications in Gnome 3.20

Hmm... I see.
So what should I do? Wait for gnome-session to be updated in repositories? Or maybe try to patch it myself?

Offline

#4 2016-04-19 09:49:42

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [SOLVED] Qt5 applications in Gnome 3.20

baihou wrote:

Hmm... I see.

It was in the comments on the bug you linked to. Comment 4 also points out a workaround (calling a dbus function to overwrite the environment variable on the settings manager). I don't use gnome, so I can't easily test this, but I think it should look like this:

$ gdbus call -e -d org.gnome.SessionManager -o /org/gnome/SessionManager -m org.gnome.SessionManager.SetEnv QT_QPA_PLATFORMTHEME qt5ct

Apparently this should be in a Gnome autostart script that runs during "the Session Manager initialization phase".

Offline

#5 2016-04-19 10:25:48

baihou
Member
Registered: 2016-04-19
Posts: 9

Re: [SOLVED] Qt5 applications in Gnome 3.20

I'm not that proficient in such a manual configuration, so sorry for silly question, but what is this Gnome autostart file? I've just tried this command of yours in a terminal and it yelled at me with this error:

Error: GDBus.Error:org.gnome.SessionManager.NotInInitialization: Setenv interface is only available during the DisplayServer and Initialization phase
(According to introspection data, you need to pass 'ss')

So where is this file available during the DisplayServer and Initialization phaze?

Offline

#6 2016-04-19 10:34:13

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [SOLVED] Qt5 applications in Gnome 3.20

I don't know enough about Gnome to answer that. There may simply be a GUI component in a "Settings" menu that allows you to add scripts to run during start up or you may need to search to discover there's a directory that you can drop scripts in or something less obvious.

At least this error message seems to confirm I got the call itself right.

Offline

#7 2016-05-02 18:08:37

baihou
Member
Registered: 2016-04-19
Posts: 9

Re: [SOLVED] Qt5 applications in Gnome 3.20

Allright, I solved this issue by manually building gnome-session package with ABS.

Offline

#8 2016-07-03 20:28:37

ravila4
Member
Registered: 2016-07-03
Posts: 1

Re: [SOLVED] Qt5 applications in Gnome 3.20

I ran into this issue too: when I ran Qt5 apps from terminal and they followed the qt5ct theme, but not when running them from the menu.
I wanted to share that this can be solved by modifying the desktop entry to: "env QT_QPA_PLATFORMTHEME=qt5ct <appname>"

Offline

Board footer

Powered by FluxBB