[Kmymoney-devel] kmymoney: Added the long awaited 'tags' feature

Alessandro Russo axela74 at yahoo.it
Sun Nov 18 13:49:24 UTC 2012


Il 18/11/2012 14:02, Cristian Onet, ha scritto:
>
> În ziua de Sîm 17 Noi 2012, la 14:30:06, Alessandro Russo a scris:
>
> I'll fix it properly as soon as possible.
>
> 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?
>
> [1] 
> http://commits.kde.org/kmymoney/889c099c8fc8cfc5c972a7b6a74af8e5ae580515
>
> -- 
>
>
Hi Cristian,
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.

My fix is this:
-----------
     QAbstractTextDocumentLayout::PaintContext ctx;
     ctx.palette = option.palette;
     // Highlighting text if item is selected
     if (m_selected)
       ctx.palette.setColor(QPalette::Text, 
option.palette.color(QPalette::Active, QPalette::HighlightedText));

     QTextDocument document;
     document.setHtml(txt);
     // adjust the text rectangle to obtain a reasonable spacing between 
the text and the grid
     painter->translate(option.rect.adjusted(2, 0, -2, 0).topLeft());
     document.documentLayout()->draw(painter, ctx);
     painter->translate(-option.rect.adjusted(2, 0, -2, 0).topLeft());
------------

Choose whatever do you prefer.

Ciao,
  Alessandro

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20121118/2035eb77/attachment.html>


More information about the KMyMoney-devel mailing list