<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace;font-size:small"><br>And BTW, just found this.. so adding CC for Lars and Simon.<br><br><a href="https://mail.kde.org/pipermail/kde-optimize/2005-June/001096.html">https://mail.kde.org/pipermail/kde-optimize/2005-June/001096.html</a></div><div class="gmail_extra"><br><div class="gmail_quote">On 18 February 2016 at 12:05, Jaroslaw Staniek <span dir="ltr"><<a href="mailto:staniek@kde.org" target="_blank">staniek@kde.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On 24 September 2015 at 23:04, David Faure <span dir="ltr"><<a href="mailto:faure@kde.org" target="_blank">faure@kde.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>On Tuesday 22 September 2015 18:44:47 Jaroslaw Staniek wrote:<br>
> On 22 September 2015 at 14:17, Jaroslaw Staniek <<a href="mailto:staniek@kde.org" target="_blank">staniek@kde.org</a>> wrote:<br>
> > Hello,<br>
> > A couple of related questions while wrestling with issues such as [1].<br>
> ><br>
> > Let's assume Kexi app installs some icons to<br>
> > PREFIX/share/kexi/icons/oxygen/32x32/places/ or<br>
> > PREFIX/share/kexi/icons/breeze/32x32/places.<br>
> > Can these be searched by the icon engine?<br>
><br>
> Sorry for adding more info to clarify.<br>
> UserIconSet is deprecated so I guess this functionality is deprecated too...<br>
> since QIcon::fromTheme() apaprently isn't able to find app icons.<br>
><br>
> I've seen quite a few KDE apps compiling-in their (usually custom<br>
> action) icons into qrc instead.<br>
><br>
> I've not seen other app that do what Calligra apps do:<br>
> using icons fron share/calligra/icons (in kdelibs4 times<br>
> share/apps/calligra/icons).<br>
><br>
> Comments?<br>
<br>
</span>I guess qrc is actually better. Otherwise app1 might start depending on icon installed<br>
by app2 (without really noticing). And this simplifies deployment (and speeds up lookup).<br></blockquote><div><br><div style="font-family:monospace,monospace;font-size:small;display:inline">Hi David & All. I am back to this topic. <br><br></div><div style="font-family:monospace,monospace;font-size:small;display:inline">I've got some experiments. .rcc files for icons is a nice thing, not to big, obviously quick to deploy. <br><br>There's <b>rcc --project</b> <br>(Outputs a qrc resource file containing all files from the current directory)<br><br></div><div style="font-family:monospace,monospace;font-size:small;display:inline">Now, how to deal with it?<br></div><div style="font-family:monospace,monospace;font-size:small;display:inline">Is a variant of KIconLoader needed that works with QResources?<br></div><div style="font-family:monospace,monospace;font-size:small;display:inline">Obviously we need a QIconEngine-level solution to have icons available on demand instead of such hacks:<br></div><div style="font-family:monospace,monospace;font-size:small;display:inline"><br></div><div style="font-family:monospace,monospace;font-size:small;display:inline"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(181,137,0)">QIcon</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">tableIcon</span><span style="color:rgb(88,110,117)">;</span>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,0)">tableIcon</span><span style="color:rgb(88,110,117)">.</span><span style="color:rgb(0,0,0)">addPixmap</span><span style="color:rgb(88,110,117)">(</span><span style="color:rgb(181,137,0)">QPixmap</span><span style="color:rgb(88,110,117)">(</span><span style="color:rgb(42,161,152)">":/icons/16-actions-table.png"</span><span style="color:rgb(88,110,117)">));</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,0)">tableIcon</span><span style="color:rgb(88,110,117)">.</span><span style="color:rgb(0,0,0)">addPixmap</span><span style="color:rgb(88,110,117)">(</span><span style="color:rgb(181,137,0)">QPixmap</span><span style="color:rgb(88,110,117)">(</span><span style="color:rgb(42,161,152)">":/icons/22-actions-table.png"</span><span style="color:rgb(88,110,117)">));</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,0)">tableIcon</span><span style="color:rgb(88,110,117)">.</span><span style="color:rgb(0,0,0)">addPixmap</span><span style="color:rgb(88,110,117)">(</span><span style="color:rgb(181,137,0)">QPixmap</span><span style="color:rgb(88,110,117)">(</span><span style="color:rgb(42,161,152)">":/icons/32-actions-table.png"</span><span style="color:rgb(88,110,117)">));</span></pre>
<pre style="margin:0px;text-indent:0px">someQAction->setIcon(<span style="color:rgb(192,192,192)"></span><span style="color:rgb(0,0,0)">tableIcon)</span></pre><br></div><div style="font-family:monospace,monospace;font-size:small;display:inline">One approach is to build rcc out of a fresh installed PREFIX/share/icons/breeze/* files and does with the paths in a standard way. This is why I am looking at opportunity of reusing the logic of KIconLoader. Or maybe it's all silly because it's ready to use and I missed something?<br><br>To build .rcc's I am using cmake's <span style="color:rgb(0,0,0)">qt5_add_binary_resources()</span> for Qt>=5.5 with some <span style="color:rgb(88,110,117)">add_custom_command() fallback for older Qt.</span><span style="color:rgb(0,0,0)"><br></span></div><div style="font-family:monospace,monospace;font-size:small;display:inline"><br></div><div style="font-family:monospace,monospace;font-size:small;display:inline">At higher level, I was thinking about a reusable implementation, that eventually would maybe land in KIconThemes if there's interest. Or maybe as a separate tiny lib. <br>I think the solution with a packaged breeze icons resource working out-of-the box could be a good (lightweight) addition for non-Plasma (non-Linux?) users of KF5, to popularize KF5. They grab the icons package and icons just work without thousands of files, caching, etc. 'One in a million' would of these users would be interested in theming. <br>And this solution is generally usable for any Qt apps even if nothing else from KF5 is used: just load .rcc dynamically and things work. <br><br>That's just a lower priority. My actual test is the application of the idea for Kexi.<br><br></div><div style="font-family:monospace,monospace;font-size:small;display:inline">PS1: Feature I'm also considering: converting svgs to pngs before creating the rcc files. Not sure but svgs can be included too, for general use in big sizes and for high DPI screens.<br><br></div><div style="font-family:monospace,monospace;font-size:small;display:inline">PS2: I have been beaten by situations such as KToolBar setting 0-size icons by default. <br></div><div style="font-family:monospace,monospace;font-size:small;display:inline">This is in a Windows env where no themes are (properly) installed. If the rcc-based solution is in use I would imagine that ideally all the KF5 code detects this somehow and would not look for xdg standard themes through the classic KIconLoader but silently adapt so the rcc resource works great. Just a dream.<br><br></div><div style="font-family:monospace,monospace;font-size:small;display:inline">PS3: A bonus of not having thousands of icon files is that some KDE apps are more capable to become 'portable apps' (in the <a href="http://portableapps.com" target="_blank">http://portableapps.com</a> meaning).<br></div><div style="font-family:monospace,monospace;font-size:small;display:inline"></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
What I don't know however is whether artists consider that these icons should be themeable...<br>
<br>
BTW did you look into the xdg icon spec?<br>
I guess it's not there?<br>
On the other hand it doesn't prevent doing it since it's not about sharing icons; it's just harder<br>
to convince Qt to look there :) (I think qiconengine and kiconengine should stay compatible,<br>
so that we can even consider switching to qiconengine one day).<span class="HOEnZb"><font color="#888888"><br>
<span><font color="#888888"><br>
--<br>
David Faure, <a href="mailto:faure@kde.org" target="_blank">faure@kde.org</a>, <a href="http://www.davidfaure.fr" rel="noreferrer" target="_blank">http://www.davidfaure.fr</a><br>
Working on KDE Frameworks 5<br>
<br>
</font></span></font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><br>-- <br><div>regards, Jaroslaw Staniek<br><br>KDE:<br>: A world-wide network of software engineers, artists, writers, translators<br>: and facilitators committed to Free Software development - <a href="http://kde.org" target="_blank">http://kde.org</a><br>Calligra Suite:<br>: A graphic art and office suite - <a href="http://calligra.org" target="_blank">http://calligra.org</a><br>Kexi:<br>: A visual database apps builder - <a href="http://calligra.org/kexi" target="_blank">http://calligra.org/kexi</a><br>Qt Certified Specialist:<br>: <a href="http://www.linkedin.com/in/jstaniek" target="_blank">http://www.linkedin.com/in/jstaniek</a></div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">regards, Jaroslaw Staniek<br><br>KDE:<br>: A world-wide network of software engineers, artists, writers, translators<br>: and facilitators committed to Free Software development - <a href="http://kde.org" target="_blank">http://kde.org</a><br>Calligra Suite:<br>: A graphic art and office suite - <a href="http://calligra.org" target="_blank">http://calligra.org</a><br>Kexi:<br>: A visual database apps builder - <a href="http://calligra.org/kexi" target="_blank">http://calligra.org/kexi</a><br>Qt Certified Specialist:<br>: <a href="http://www.linkedin.com/in/jstaniek" target="_blank">http://www.linkedin.com/in/jstaniek</a></div>
</div></div>