site  contact  subhomenews

Qt4 theme matches GTK2 theme

March 29, 2013 — BarryK
Pemasu gave me the hint that got me going on this. See previous post about Woof move to 96 dpi:

I found out that Qt4 apps can be made to automatically match the current GTK+2 theme. This is great news, it makes theming for mixed Qt4 and GTK+2 apps so simple.

There are three tricks to it. Firstly, /root/.config/Trolltech.conf is required, with just this in it:

font="DejaVu Sans,10,-1,5,50,0,0,0,0,0"

Secondly, /etc/rc.d/profile.d/pup_gtk has just this line:

export GTK2_RC_FILES=/root/.gtkrc-2.0

And thirdly, some means is required to append this line to /root/.gtkrc-2.0:

gtk-theme-name="<name of gtk theme>"

Which I have done by modifying the template for the GTK+2 theme-setter 'gtk-chtheme' in Woof, to append that line after running 'gtk-chtheme' executable.

It works great, Qt4 apps like just like the GTK+2 apps.
The downside is that Qt5 uses a different theming system, as does GTK+3. There is currently no method to get GTK+3 apps to match those of GTK+2 apps, which is most unfortunate.

Woof commit:

Note, the gtk-chtheme template is only applied to a package from a host-distro, not to a PET. So, any existing gtk-chtheme PET will have to be manually modified.
My current Upups use gtk-chtheme DEB package, so OK, but Slacko and my spup14 use the PET from 'common' repo, so I will fix that.


Qt4 theme match GTK+2
Username: BarryK
One more thing, a change was required in 3builddistro. Woof commit: Also, I have fixed the 'gtk-chtheme' PET package, as described above (11K):

Qt5 supports GTK+2 themes
Username: BarryK
"disciple, Ah, yes, you are right. Reading this page: It seems that Qt5 will still support the "GTK+" style, based on GTK+2 themes. They are not supporting GTK+3 themes yet. Interesting, Qt seems to be pulling ahead of GTK:

Tags: woof