[Development] Supporting freedesktop icon themes in Qt5
adys.wh at gmail.com
Thu May 10 12:54:45 CEST 2012
On Thu, May 10, 2012 at 8:27 AM, Pier Luigi <pierluigi.fiorini at gmail.com>wrote:
> 2012/5/10 Jerome Leclanche <adys.wh at gmail.com>:
> > Morning
> > Qt currently does not properly support icon themes on Linux. This is a
> > issue here for Razor  as we're a non-KDE-based DE trying to use pure
> > Qt. QIcon::fromTheme has some heuristics for KDE and Gnome, but other DEs
> > are not supported. 
> > We'd like to get this fixed for Qt5.0. My first attempt at getting it
> > was through a proposal for icon theme configuration, which was (rightly)
> > rejected by the GTK team. After talking with them, they explained how
> > use xsettings for it  -- kde has a kde-xsettings plugin which
> > xsettings on KDE too, so that could theoretically be used there too.
> > it also means Qt is going to need an xsettings backend.
> > I linked a discussion post about it on #qt-labs yesterday, log below:
> > <girishr_> Adys: sounds acceptable to me. we only don't allow api
> changes at
> > this point
> > <girishr_> Adys: any fixes to make desktop integration better are welcome
> > <Adys> girishr_: it would be an internal change, but depending on how big
> > xsettings support would have to be, it'd be a large changeset
> > <girishr_> Adys: i don't think we had xsettings in qt, so i think the
> > is correct that Qt needs to have an implementation of that first
> > <girishr_> Adys: it affects only xcb plugin, so shouldn't be a problem
> > <girishr_> Adys: sroedal is the xcb maintainer afaik
> > I'm not qualified to work on something like this, and the rest of the
> > team isn't too available currently, so this is mostly a FYI post. I was
> > really hopeful to have this issue fixed for Qt 5.0, so if someone wants
> > or is planning to work on it I'd love to know.
> >  http://razor-qt.org/
> > 
> >  http://git.gnome.org/browse/gtk+/tree/gdk/x11/gdksettings.c
> Icon themes works very well for me in my desktop environment, you
> should write a platform theme plugin (QPlatformTheme) which reads
> Razor settings.
> If the DESKTOP_SESSION environment variable contains the name of your
> plugin, it will be used.
> "Don't let the noise of other's opinions drown out your own inner
> voice." (Steve Jobs)
I've never heard of that method until now. It doesn't seem like the correct
answer for a few reasons though:
- $DESKTOP_SESSION has been deprecated in multiple DEs in favour of
- That method requires every DE to write their own Qt plugin *and* their
own icon theme settings engine.
That's to say, it assumes that the DE itself wants to store icon theme
settings, when a simple third party app could be doing it. (Razor is
extremely lightweight and tries to rely as much as possible on third party
However, if the DE stores the icon theme in xsettings:
- Any app is able to change it without having to read every custom
settings engine known to mankind
- Any app is able to tell the *current* icon theme, not specifically the
*preferred* one (Reading settings only gets you so far)
- The DE gets automatic integration with Qt *without* having to write its
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Development