[Development] Supporting freedesktop icon themes in Qt5

Pier Luigi pierluigi.fiorini at gmail.com
Thu May 10 09:27:39 CEST 2012

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)

More information about the Development mailing list