QT theme search paths limited on Windows

Jasem Mutlaq mutlaqja at ikarustech.com
Wed Jun 29 22:23:08 UTC 2016


Hello,

KStars has problems loading custom icons that were installed into the
"hicolor" theme under Windows. On Linux, it works perfectly fine. Upon
checking QIcon::themeSearchPaths(), turns out on LInux it's the following:

Theme search path  ("/usr/share/icons", "/usr/share/pixmaps", ":/icons")

But on Windows, it's only ":/icons"

I solved by adding the theme names manually under Windows:

QStringList searchPaths = QIcon::themeSearchPaths();
foreach(QString path,
QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation))
        searchPaths << QString("%1/%2").arg(path).arg("icons");
QIcon::setThemeSearchPaths(searchPaths);

After that, the icons under "hicolor" loaded up fine. Perhaps Qt should be
patched to add those paths so that all KDE applications can access them
without the above hack?

-- 
Best Regards,
Jasem Mutlaq
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-windows/attachments/20160630/067533c7/attachment.html>


More information about the Kde-windows mailing list