<div>Hello all,<br></div><div>I just commited a big refactor of charts which I have been working on for the past weeks.</div><div><br></div><div>There is still a missing functionality, which is to show the charts on the home page.</div>
<div><br></div><div>Here is the relevant code, from khomeview.cpp</div><div><br></div><div>QPixmap pm = QPixmap::grabWidget(chartWidget->coordinatePlane()->parent(), 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\" cellpadding=\"2\" class=\"summarytable\" >");<br>
m_html += QString("<tr>");<br> //m_html += QString("<td><center><IMG SRC=\"data:image/png;base64,%1\" ALT=\"Networth\"></center></td>").arg(ba->toBase64().data());<br>
m_html += QString("</tr>");<br> m_html += QString("</table></div></div>");<br></div><div><br></div><div>As you can, the relevant line is commented out for the moment, because the conversion from the buffer which has the QPixmax stored, to base64 to then show it on the home page, causes a crash.</div>
<div><br></div><div>Now, I don't know if there is another way to do it. We have to show a widget on an khtml_part, if possible, without using a temporary file, which would be the usual in this case. There are too many security implications to have a temporary file lying around with financial data.</div>
<div><br></div><div>So, does anyone have a clue how to do this? There were some changes from KDE3 that prevent a straight port.</div><div><br></div><div>Regards,</div><div>Alvaro</div>