You are not logged in.

#1 2017-08-05 17:33:44

DeepDayze
Member
From: In Linux Land
Registered: 2017-05-28
Posts: 243

QT theming

How can QT applications easily pick up the theme in use and what packages and configuration is needed to get themes to work with QT apps  in Openbox environment?


Real Men Use Linux

Offline

#2 2017-08-05 19:16:55

Head_on_a_Stick
Moderator
From: London
Registered: 2015-09-29
Posts: 7,228

Re: QT theming

We use this line (in ~/.xsessionrc, use ~/.profile for console logins):

export QT_STYLE_OVERRIDE=GTK+

https://github.com/BunsenLabs/bunsen-co … ssionrc#L9

This causes Qt applications to attempt to match to the GTK theme in use but only works for Hydrogen/Deuterium/jessie.

For Helium/stretch, see https://wiki.archlinux.org/index.php/Qt … KDE_Plasma


Charlie don't hack.

Forum Rules   •   How to report a problem   •   bunsenlabs(7)

Offline

#3 2017-08-05 20:24:49

DeepDayze
Member
From: In Linux Land
Registered: 2017-05-28
Posts: 243

Re: QT theming

the qt5ct package is not in Debian I can see.


Real Men Use Linux

Offline

#4 2017-08-05 20:35:34

Head_on_a_Stick
Moderator
From: London
Registered: 2015-09-29
Posts: 7,228

Re: QT theming

^ The application requires Qt's private headers so Debian will not package it, apparently.

https://bugs.debian.org/cgi-bin/bugrepo … =822246#25

Unofficial version here:

https://github.com/mati75/qt5ct

I ♥ startpage.com...


Charlie don't hack.

Forum Rules   •   How to report a problem   •   bunsenlabs(7)

Offline

#5 2017-08-05 20:55:38

DeepDayze
Member
From: In Linux Land
Registered: 2017-05-28
Posts: 243

Re: QT theming

Head_on_a_Stick wrote:

^ The application requires Qt's private headers so Debian will not package it, apparently.

https://bugs.debian.org/cgi-bin/bugrepo … =822246#25

Unofficial version here:

https://github.com/mati75/qt5ct

I ♥ startpage.com...


Ahh now I understand so I would have to compile this myself.


Real Men Use Linux

Offline

#6 2017-08-05 21:01:10

Head_on_a_Stick
Moderator
From: London
Registered: 2015-09-29
Posts: 7,228

Re: QT theming


Charlie don't hack.

Forum Rules   •   How to report a problem   •   bunsenlabs(7)

Offline

#7 2017-08-06 04:43:34

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 3,337
Website

Re: QT theming

Could it be that the Debian package qt5-gtk-platformtheme would help?


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#8 2017-08-06 19:31:14

Head_on_a_Stick
Moderator
From: London
Registered: 2015-09-29
Posts: 7,228

Re: QT theming

johnraff wrote:

Good find, yes, that looks very useful — mark for inclusion with Helium?

I will test it once I get my BL laptop working again...


Charlie don't hack.

Forum Rules   •   How to report a problem   •   bunsenlabs(7)

Offline

#9 2017-08-07 03:06:01

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 3,337
Website

Re: QT theming

Head_on_a_Stick wrote:
johnraff wrote:

Good find, yes, that looks very useful — mark for inclusion with Helium?
I will test it once I get my BL laptop working again...

Yes, let's wait until someone has actually used it and found it useful! I just did a quick debian repo search for qt5* smile


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#10 2017-08-07 12:37:19

earlybird
ほやほや
Registered: 2015-12-16
Posts: 472
Website

Re: QT theming

johnraff wrote:
Head_on_a_Stick wrote:
johnraff wrote:

Good find, yes, that looks very useful — mark for inclusion with Helium?
I will test it once I get my BL laptop working again...

Yes, let's wait until someone has actually used it and found it useful! I just did a quick debian repo search for qt5* smile

I think there was a caveat that the platform theme works only by setting a special environment variable outside of GNOME sessions: https://wiki.archlinux.org/index.php/Un … mePlatform. This variable needs to be set for the complete X user session (so perhaps via lightdm or so).

[I dimly recall there being other problems with the platform theme over qt5ct (Qt5 regression somewhere, maybe).]

Offline

#11 2017-08-07 16:36:05

Naik
Member
From: Lipsia
Registered: 2015-10-03
Posts: 147

Re: QT theming

johnraff wrote:

I got it running on my BunSidLabs install just some days ago and found it made much improvement to the optical integration of qt-applications. So i would vote for it.

Package: qt5-gtk-platformtheme
Source: qtbase-opensource-src
Version: 5.7.1+dfsg-4
Installed-Size: 452
Maintainer: Debian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Architecture: amd64

naik --greetz


"Kaum macht [Mensch]* es richtig, funktioniert es sofort!"
BL-Kitchen on GitHub

Offline

#12 2017-08-07 17:02:06

damo
....moderator....
Registered: 2015-08-20
Posts: 4,169

Re: QT theming

I'm going to need to test this out: Openshot from the stretch repos is crashing all the time, but Openshot-QT seems much more stable (and has a nice shiny-black theme hmm )


Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#13 2017-08-29 09:01:00

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 3,337
Website

Re: QT theming

Has anyone tried qt5-gtk-platformtheme?

Any suggestions for good test qt5 apps available in stretch, that could be used for a before-and-after comparison?
ie apps where the GUI improvement brought by installing qt5-gtk-platformtheme ought to be obvious?


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#14 2017-08-29 13:13:32

Steve
Member
Registered: 2017-01-03
Posts: 568

Re: QT theming

johnraff wrote:

Has anyone tried qt5-gtk-platformtheme?

Any suggestions for good test qt5 apps available in stretch, that could be used for a before-and-after comparison?
ie apps where the GUI improvement brought by installing qt5-gtk-platformtheme ought to be obvious?

Ive been trying out notepadqq in my debian stretch install. Not available in stretch though, had to compile from source. Id be interested to know this also. I know qupzilla the web browser uses qt5 so maybe there are some differences with that from previous. I notice qt5-gtk-platformtheme is already installed in my system.

http://notepadqq.altervista.org/wp/

Offline

#15 2017-08-30 05:39:26

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 3,337
Website

Re: QT theming

qupzilla had a lot of qt5 dependencies, so it looked like a good test.
In a stretch VM, I couldn't detect any difference in appearance before and after installing qt5-gtk-platformtheme.
It was using the built-in "Linux Default" theme - bland enough, but different from BL "Beam", which Firefox, for example, was more-or-less following. Qupzilla's icons, too, were taken from the same default set that root uses, not my configured Papirus.
hPgL54bt.png
Maybe some further configuration is needed to use qt5-gtk-platformtheme?


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#16 2017-08-30 13:55:16

earlybird
ほやほや
Registered: 2015-12-16
Posts: 472
Website

Re: QT theming

johnraff wrote:

qupzilla had a lot of qt5 dependencies, so it looked like a good test.
In a stretch VM, I couldn't detect any difference in appearance before and after installing qt5-gtk-platformtheme.
It was using the built-in "Linux Default" theme - bland enough, but different from BL "Beam", which Firefox, for example, was more-or-less following. Qupzilla's icons, too, were taken from the same default set that root uses, not my configured Papirus.
http://i.imgur.com/hPgL54bt.png
Maybe some further configuration is needed to use qt5-gtk-platformtheme?

Yes some sort of environment variable, AFAICT QT_QPA_PLATFORMTHEME=qt5ct and the theme must be configured using qt5ct (helper program), probably creates an INI file somewhere.

Offline

#17 2017-08-30 17:56:55

stevep
MX Linux Developer
Registered: 2016-08-08
Posts: 195

Re: QT theming

The Kvantum Qt theme engine and manager comes with a lot of themes, so maybe you could  use that to match up with the GTK theme...ones like the Arc theme, for example.

https://store.kde.org/content/show.php/ … ent=166241

And of course, you know I'm only writing this because I have it in a repository  wink

https://build.opensuse.org/package/show … le-kvantum

It's a single deb package, so it's easier to just download the deb and install it with gdebi or in Stretch, apt also works like gdebi to install debs and pull in missing dependencies.  The Kvantum manager shows up in Settings.  Note that since Qt5 theming doesn't work with versions less than Qt5.4, the packages for distros with older Qt5s are Qt4 only.  Stretch and newer Ubuntu packages work for both Qt4 and 5.  The debian/rules and control file contain some code that automatically determine what distro and Qt5 version is in the build platform, and adjust the build automatically--that way one set of source files "fits all". (I saw how the Jessie backports for openjdk-8 did some similar kind of adjusting, adapted that for the Pale Moon Stretch to build against gcc-4.9 per the PM developers mandate, and then adapted it for Kvantum.)

Anyway, I also tried yesterday building notepadqq from some PPA source, but the build procedure errors out when built using Stretch's debhelper 10; even debhelper 10 in Jessie from jessie-backports.

https://build.opensuse.org/package/show … /notepadqq

Something about no permission to install stuff in the directories, such as /usr/share/icons.  So far I'm stumped on how to fix that elegantly, though a kludge could be to forwardport debhelper 9 to Stretch in my repo, and insist that it be built against that.  If anyone has advice on how to fix the debhelper 10 build, I'm listening! You can get to the repo, which contains the sources and debs, by clicking the distro links on the right, then clicking the "go to download repository" link on the next page.

Anyway, I would bet that the Jessie packages (it's a multi-deb package) would run just
fine in Stretch in the meantime.

Last edited by stevep (2017-08-30 18:18:45)

Offline

#18 2017-08-31 00:58:01

Steve
Member
Registered: 2017-01-03
Posts: 568

Re: QT theming

^ steve, i followed the github instructions to build notepadqq on debian 9 if that helps. Doesnt follow the gtk theme though, it uses the default adwaita theme, roots theme? I will have to have a look at that Kvantum program, looks interesting, cheers.

Also notpadqq comes with a heap of different colour schemes, like over 20 or more.

https://github.com/notepadqq/notepadqq

Offline

#19 2017-08-31 01:26:55

stevep
MX Linux Developer
Registered: 2016-08-08
Posts: 195

Re: QT theming

Steve wrote:

^ steve, i followed the github instructions to build notepadqq on debian 9 if that helps. Doesnt follow the gtk theme though, it uses the default adwaita theme, roots theme? I will have to have a look at that Kvantum program, looks interesting, cheers.

Also notpadqq comes with a heap of different colour schemes, like over 20 or more.

https://github.com/notepadqq/notepadqq

I tested the jessie packages of notepadqq in Stretch, and they had no trouble installing.  There's also a notepadqq-gtk package that gets generated that's supposed to make it follow the GTK theme, but I haven't tested it. Let me look at it, maybe it just starts it with the command to follow the theme.  Yeah, it's just a script

/usr/lib/notepadqq/notepadqq.sh -style=gtk "$@"

and notepadqq.sh is... a lot of stuff, mostly concerning manually installed versions of Qt 5.  Maybe the Arch Wiki can shed some light on the situation:  https://wiki.archlinux.org/index.php/Un … plications

No doubt the debhelper 10 problem is due to something like an issue with the syntax of the commands in the debian/rules or the install files; it's a lot more fancy than just make and "make install", but a lot of it is right at the upper levels of my limited understanding.

Offline

#20 2017-08-31 07:41:12

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 3,337
Website

Re: QT theming

The idea for BL at this point would have been to provide some way for QT5 apps to follow whatever GTK theme the user had chosen, the same way QT4 would do if QT_STYLE_OVERRIDE=GTK+ was set.

Installing a QT theme engine and choosing something to match our current default theme sounds like a less attractive option.

Unfortunately qt5ct is not available in Debian atm, and it seems to overrule Plasma settings too, although the issue here is getting the occasional QT5 app to fit in on a basically GTK desktop, so Plasma shouldn't be around.

Something appears to have changed with QT5.7 (stretch) which might have been fixed in 5.8, but too late for Helium. I doubt if anyone is going to backport the whole  QT5 collection from Buster!

It looks very messy:
https://bugs.launchpad.net/ubuntu/+sour … ug/1695618
https://wiki.archlinux.org/index.php/qt … KDE_Plasma
https://wiki.archlinux.org/index.php/Un … in_Qt_apps
https://lists.debian.org/debian-qt-kde/ … 00219.html
https://github.com/manjaro/release-plan/issues/73
https://bbs.archlinux.org/viewtopic.php?id=214147

But I have made a little progress with qupzilla. smile
1) Install qt5-style-plugins
2) Put 'export QT_QPA_PLATFORMTHEME=gtk2' in eg ~/.xsessionrc
and qupzilla now shows the current GTK theme colours and widgets.
It still doesn't use the set icon theme though. neutral

EDIT screenshot:
sO0QFhmt.png

( I guess for GTK3 theming to work, we'd have to use a custom package of qt5ct , and reset QT_QPA_PLATFORMTHEME=qt5ct )

EDIT2 apologies for some duplication of what was in previous posts that I hadn't read completely.

Last edited by johnraff (2017-09-02 06:31:57)


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#21 2017-09-07 04:55:42

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 3,337
Website

Re: QT theming

Naik wrote:
johnraff wrote:

I got it running on my BunSidLabs install just some days ago and found it made much improvement to the optical integration of qt-applications.

johnraff wrote:

Has anyone tried qt5-gtk-platformtheme?

@Naik - apologies for overlooking your post. (How did I miss it? ops )

Anyway, you used it on Sid, where QT5 has moved on to 5.9 or so. It looks as if there are problems with QT5.7 which is what we have on Debian Stretch.

What I think I've understood:
qt5-gtk-platformtheme is for GTK3 themes, but isn't supported on Stretch.
qt5-style-plugins is for GTK2 themes, but works on Stretch.

(more to follow)

Last edited by johnraff (2017-09-07 06:17:40)


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#22 2017-09-07 08:53:10

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 3,337
Website

Re: QT theming

icons

To get all (er... most) icons to display in QT5 apps, install libqt5svg5.

qt5ct is available as an installable deb from the above linked ppa, but I found it not to be necessary if you just want QT5 apps to copy your GTK2 and icon themes.

Summary:
NB this is for Helium/Stretch.

Install:
qt5-style-plugins
libqt5svg5

Edit the "for qt5 apps" section of ~/.xsessionrc thus:

# for qt5 apps
#export QT_STYLE_OVERRIDE=GTK+
export QT_QPA_PLATFORMTHEME=gtk2

Logout/in, start up a QT5 app such as qupzilla or juffed.
Also open lxappearance (menu>preferences>appearance) and try switching the gtk theme or icon theme. The qt5 apps should follow without needing to be restarted. For some reason the faenza-bunsen icon themes aren't detected (inheritance problem?) but Paper, Papirus and others all seemed OK.

Last edited by johnraff (2017-09-07 09:24:35)


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#23 2017-09-07 18:11:46

Head_on_a_Stick
Moderator
From: London
Registered: 2015-09-29
Posts: 7,228

Re: QT theming

johnraff wrote:

Install:
qt5-style-plugins
libqt5svg5

Edit the "for qt5 apps" section of ~/.xsessionrc thus:

# for qt5 apps
#export QT_STYLE_OVERRIDE=GTK+
export QT_QPA_PLATFORMTHEME=gtk2

This works for the icons but not the theme, weirdly  hmm

2017-09-07-190515_1920x1080_scrot.th.png

Changing the theme (directly or with lxappearance) does not alter the application's appearance, even after a restart.


Charlie don't hack.

Forum Rules   •   How to report a problem   •   bunsenlabs(7)

Offline

#24 2017-09-08 01:51:46

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 3,337
Website

Re: QT theming

^Hmm that's strange, and disappointing. You are testing on Debian Stretch, right? No backported QT libraries?

In the interests of science I installed kwrite on my Helium test VM - it brought in a huge list of dependencies - and ran it. Apart from the same icon error messages you got, no issues, and the theming matched my GTK setting. Both gtk themes and icon themes could be changed on the fly with lxappearance, just like qupzilla and jeffed:
OPXeiaCm.png

Is there something different in your environment? Here's my 'env':

john@helium-net:~$ env
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
TERMINATOR_UUID=urn:uuid:26117e66-25a0-41b9-b2f6-7ffbf5eb911f
LANG=en_GB.UTF-8
DISPLAY=:0
GTK_CSD=0
COLORTERM=truecolor
XDG_VTNR=7
SSH_AUTH_SOCK=/tmp/ssh-vtpd8mIQ53wh/agent.1580
XDG_SESSION_ID=2
XDG_GREETER_DATA_DIR=/var/lib/lightdm/data/john
USER=john
DESKTOP_SESSION=lightdm-xsession
QT_QPA_PLATFORMTHEME=gtk2
PWD=/home/john
HOME=/home/john
SSH_AGENT_PID=1656
QT_ACCESSIBILITY=1
XDG_SESSION_TYPE=x11
XDG_SESSION_DESKTOP=lightdm-xsession
TERM=xterm-256color
SHELL=/bin/bash
VTE_VERSION=4601
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_CURRENT_DESKTOP=XFCE
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
SHLVL=1
XDG_SEAT=seat0
LANGUAGE=en_GB:en
GDMSESSION=lightdm-xsession
LOGNAME=john
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
XDG_RUNTIME_DIR=/run/user/1000
XAUTHORITY=/home/john/.Xauthority
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
PATH=/home/john/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
LD_PRELOAD=libgtk3-nocsd.so.0
_=/usr/bin/env

John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#25 2017-09-08 06:12:01

Head_on_a_Stick
Moderator
From: London
Registered: 2015-09-29
Posts: 7,228

Re: QT theming

johnraff wrote:

You are testing on Debian Stretch, right? No backported QT libraries?

Yes, it's a (relatively) fresh debootstrap+bunsen-netinstall Helium-dev system.

I must have molested it in some significant way, I will check out the `env` output and probably re-install anyway tonight.


Charlie don't hack.

Forum Rules   •   How to report a problem   •   bunsenlabs(7)

Offline

Board footer

Powered by FluxBB