QIcon::fromTheme on non linux platforms

Jeremy Whiting jpwhiting at kde.org
Wed Dec 10 03:34:23 GMT 2014

Hey all,

In looking into building some kde applications on windows and mac besides
linux I've come across a minor hiccup. In many applications and frameworks
possibly we use QIcon::fromTheme to get icons from a named icon. This is
even recommended in the kf5 porting notes, however on non linux platforms
we hit a couple of issues. QIcon::fromTheme's documentation says it's not
meant to work on non linux platforms or if we want it to work there we need
to install icons into some theme path, add the theme to the application's
themeSearchPaths and set the name with setThemeName.

For kde on windows this is ok since the qt built with the emerge tool is
patched to set the theme name to "oxygen" however it's not ideal and
doesn't act the same as on linux itself where oxygen is the icon theme but
hicolor is a fallback (and there could be others from what I gather besides
the oxygen theme itself). All the ecm_install_icons calls in kdeedu
applications that I saw install into hicolor theme, or don't set a theme
and end up in hicolor by default. So the question then becomes what's the
correct/best way to get this functionality on non linux platforms? Is
QIcon::fromTheme something that comes from the platform plugin or do we
need to use patched Qt on those platforms to support getting the icons our
applications need?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20141209/d9151b9c/attachment.htm>

More information about the kde-core-devel mailing list