[Development] Supporting freedesktop icon themes in Qt5

Jerome Leclanche 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
> big
> > issue here for Razor [1] 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. [2]
> > We'd like to get this fixed for Qt5.0. My first attempt at getting it
> fixed
> > was through a proposal for icon theme configuration, which was (rightly)
> > rejected by the GTK team. After talking with them, they explained how
> they
> > use xsettings for it [3] -- kde has a kde-xsettings plugin which
> implements
> > xsettings on KDE too, so that could theoretically be used there too.
> However
> > 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
> post
> > 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
> Razor
> > 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
> to
> > or is planning to work on it I'd love to know.
> >
> > [1] http://razor-qt.org/
> > [2]
> https://qt.gitorious.org/qt/qt/blobs/4.8/src/gui/kernel/qguiplatformplugin.cpp#line201
> > [3] 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
application integration)

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
own plugin.

J. Leclanche
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120510/5d94ef33/attachment.html>

More information about the Development mailing list