<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Il 18/11/2012 14:02, Cristian Oneț ha
      scritto:<br>
    </div>
    <blockquote cite="mid:2846025.nRs5ubSxBv@linda" type="cite">
      <meta name="qrichtext" content="1">
      <style type="text/css">
p, li { white-space: pre-wrap; }
</style>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:0;">În ziua de Sîm 17 Noi 2012, la 14:30:06,
        Alessandro Russo a scris:<br>
      </p>
      <p style=" margin-top:12px; margin-bottom:12px; margin-left:40px;
        margin-right:40px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:0;">I'll fix it properly as soon as possible.</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:0;">I think that this solution [1] is acceptable.
        If we now have rich text drawing we can improve the ledger
        further by adding rich text markers including icons, any
        suggestions?</p>
      <p style="-qt-paragraph-type:empty; margin-top:0px;
        margin-bottom:0px; margin-left:0px; margin-right:0px;
        -qt-block-indent:0; text-indent:0px; "> </p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:0;">[1]
        <a class="moz-txt-link-freetext" href="http://commits.kde.org/kmymoney/889c099c8fc8cfc5c972a7b6a74af8e5ae580515">http://commits.kde.org/kmymoney/889c099c8fc8cfc5c972a7b6a74af8e5ae580515</a><br>
      </p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:0;">-- </p>
      <br>
    </blockquote>
    Hi Cristian,<br>
    yesterday my UPS died and took with itself the power supply of my pc
    so I couldn't open a new review request in the reviewboard.<br>
    <br>
    My fix is this:<br>
    -----------<br>
        QAbstractTextDocumentLayout::PaintContext ctx;<br>
        ctx.palette = option.palette;<br>
        // Highlighting text if item is selected<br>
        if (m_selected)<br>
          ctx.palette.setColor(QPalette::Text,
    option.palette.color(QPalette::Active, QPalette::HighlightedText));<br>
    <br>
        QTextDocument document;<br>
        document.setHtml(txt);<br>
        // adjust the text rectangle to obtain a reasonable spacing
    between the text and the grid<br>
        painter->translate(option.rect.adjusted(2, 0, -2,
    0).topLeft());<br>
        document.documentLayout()->draw(painter, ctx);<br>
        painter->translate(-option.rect.adjusted(2, 0, -2,
    0).topLeft());<br>
    ------------<br>
    <br>
    Choose whatever do you prefer.<br>
    <br>
    Ciao,<br>
     Alessandro<br>
    <br>
  </body>
</html>