<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-&gt;coordinatePlane()-&gt;parent(), QRect(QPoint(0, 0), QPoint(chartWidget-&gt;width(), chartWidget-&gt;height())));<br>
  QByteArray* ba;<br>  QBuffer buffer( ba );<br>  buffer.open( QIODevice::WriteOnly );<br>  pm.save( &amp;buffer, &quot;PNG&quot; ); // writes pixmap into ba in PNG format<br><br>  m_html += QString(&quot;&lt;table width=\&quot;100%\&quot; cellspacing=\&quot;0\&quot; cellpadding=\&quot;2\&quot; class=\&quot;summarytable\&quot; &gt;&quot;);<br>
  m_html += QString(&quot;&lt;tr&gt;&quot;);<br>  //m_html += QString(&quot;&lt;td&gt;&lt;center&gt;&lt;IMG SRC=\&quot;data:image/png;base64,%1\&quot; ALT=\&quot;Networth\&quot;&gt;&lt;/center&gt;&lt;/td&gt;&quot;).arg(ba-&gt;toBase64().data());<br>
  m_html += QString(&quot;&lt;/tr&gt;&quot;);<br>  m_html += QString(&quot;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&quot;);<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&#39;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>