<br><br><div class="gmail_quote">On Fri, Oct 23, 2009 at 8:15 AM, Thomas Baumgart <span dir="ltr"><<a href="mailto:thb@net-bembel.de">thb@net-bembel.de</a>></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>
> Hello all,<br>
> I just commited a big refactor of charts which I have been working on for<br>
> the past weeks.<br>
><br>
> There is still a missing functionality, which is to show the charts on the<br>
> home page.<br>
><br>
> Here is the relevant code, from khomeview.cpp<br>
><br>
> QPixmap pm = QPixmap::grabWidget(chartWidget->coordinatePlane()->parent(),<br>
> QRect(QPoint(0, 0), QPoint(chartWidget->width(), chartWidget->height())));<br>
> QByteArray* ba;<br>
> QBuffer buffer( ba );<br>
> buffer.open( QIODevice::WriteOnly );<br>
> pm.save( &buffer, "PNG" ); // writes pixmap into ba in PNG format<br>
><br>
> m_html += QString("<table width=\"100%\" cellspacing=\"0\"<br>
> cellpadding=\"2\" class=\"summarytable\" >");<br>
> m_html += QString("<tr>");<br>
> //m_html += QString("<td><center><IMG SRC=\"data:image/png;base64,%1\"<br>
> ALT=\"Networth\"></center></td>").arg(ba->toBase64().data());<br>
> m_html += QString("</tr>");<br>
> m_html += QString("</table></div></div>");<br>
><br>
> As you can, the relevant line is commented out for the moment, because the<br>
> conversion from the buffer which has the QPixmax stored, to base64 to then<br>
> 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(&bytes);<br>
buffer.open(QIODevice::WriteOnly);<br>
pixmap.save(&buffer, "PNG"); // 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'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>