<br><br><div class="gmail_quote">On Fri, Oct 23, 2009 at 8:15 AM, Thomas Baumgart <span dir="ltr">&lt;<a href="mailto:thb@net-bembel.de">thb@net-bembel.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Friday 23 October 2009 12:56:30 Alvaro Soliverez wrote:<br>
&gt; Hello all,<br>
&gt; I just commited a big refactor of charts which I have been working on for<br>
&gt; the past weeks.<br>
&gt;<br>
&gt; There is still a missing functionality, which is to show the charts on the<br>
&gt; home page.<br>
&gt;<br>
&gt; Here is the relevant code, from khomeview.cpp<br>
&gt;<br>
&gt; QPixmap pm = QPixmap::grabWidget(chartWidget-&gt;coordinatePlane()-&gt;parent(),<br>
&gt; QRect(QPoint(0, 0), QPoint(chartWidget-&gt;width(), chartWidget-&gt;height())));<br>
&gt; QByteArray* ba;<br>
&gt; QBuffer buffer( ba );<br>
&gt; buffer.open( QIODevice::WriteOnly );<br>
&gt; pm.save( &amp;buffer, &quot;PNG&quot; ); // writes pixmap into ba in PNG format<br>
&gt;<br>
&gt; m_html += QString(&quot;&lt;table width=\&quot;100%\&quot; cellspacing=\&quot;0\&quot;<br>
&gt; cellpadding=\&quot;2\&quot; class=\&quot;summarytable\&quot; &gt;&quot;);<br>
&gt; m_html += QString(&quot;&lt;tr&gt;&quot;);<br>
&gt; //m_html += QString(&quot;&lt;td&gt;&lt;center&gt;&lt;IMG SRC=\&quot;data:image/png;base64,%1\&quot;<br>
&gt; ALT=\&quot;Networth\&quot;&gt;&lt;/center&gt;&lt;/td&gt;&quot;).arg(ba-&gt;toBase64().data());<br>
&gt; m_html += QString(&quot;&lt;/tr&gt;&quot;);<br>
&gt; m_html += QString(&quot;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&quot;);<br>
&gt;<br>
&gt; As you can, the relevant line is commented out for the moment, because the<br>
&gt; conversion from the buffer which has the QPixmax stored, to base64 to then<br>
&gt; show it on the home page, causes a crash.<br>
<br>
</div>Straight from the Qt docs:<br>
<br>
     QPixmap pixmap;<br>
     QByteArray bytes;<br>
     QBuffer buffer(&amp;bytes);<br>
     buffer.open(QIODevice::WriteOnly);<br>
     pixmap.save(&amp;buffer, &quot;PNG&quot;); // writes pixmap into bytes in PNG format<br>
<br>
which is identical to Qt3 (so we have another bug to fix here in the KDE3<br>
version - I&#39;ll take care of it).<br>
<br></blockquote></div><br>Great. I will try that as soon as I come back home.<br><br>Btw, the charts now have tooltips using a native method of KDChart, but they are not fully identical to the ones in KDE3. I still have to add the calculations for the percentage.<br>
Also, there are some regressions, like when you have a lot of accounts, the legend box goes crazy, and the khtml_part not hiding when it should. But neither is a blocking bug, so we can move on and fix as we go.<br><br>Regards,<br>
Alvaro<br>