Themed icons on Windows

Aleix Pol aleixpol at kde.org
Mon May 26 01:44:54 UTC 2014


On Mon, May 26, 2014 at 3:05 AM, Nicolás Alvarez
<nicolas.alvarez at gmail.com>wrote:

> The QIcon::fromTheme documentation says:
> "By default, only X11 will support themed icons. In order to use
> themed icons on Mac and Windows, you will have to bundle a compliant
> theme in one of your themeSearchPaths and set the appropriate
> themeName."
>
> I can confirm this; Okteta5 doesn't show icons on Windows. To make it
> work I added QIcon::setThemeName("oxygen"); and a hardcoded path in
> setThemeSearchPaths after creating the QApplication, but that's a
> hack...
>
> How do we solve this properly? Having the KDE-Windows team patch every
> app to add setThemeSearchPaths is...certainly an option, but far from
> the best one :)
>
> Put the setThemeName and setThemeSearchPaths in a kguiaddons /
> kiconthemes / someframework function and have every KDE app call it?
> Make KDE-on-Windows use a patched or different QPA with a modified
> QPlatformTheme::themeHint? Other ideas?
>
> --
> Nicolás
> _______________________________________________
> Kde-frameworks-devel mailing list
> Kde-frameworks-devel at kde.org
> https://mail.kde.org/mailman/listinfo/kde-frameworks-devel
>

An alternative can be making KGuiAddons depend on a library that, on
windows, registers a Q_COREAPP_STARTUP_FUNCTION function that will set up
anything that's needed.

The tricky part is that obviously not all applications will depend on
KGuiAddons.

In the long term, it sounds like it could be a good idea to figure this out
in Qt, so that we don't have to do these things. For example, we could do
something like providing Qt-dependent files that the QPA can read if it's
not X11 platform and figure out the icon paths.

Aleix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140526/29b1043f/attachment.html>


More information about the Kde-frameworks-devel mailing list