naresh
20th September 2006, 16:19
Hi there, i'm trying to display links inside TreeView with my custom model.
1. Item has element QTextDocument *doc;
2. doc contains HTML content ( i.e <a href="http://link">http://link</a>).
3. delegate accesses items doc and uses doc->drawContents( painter, option.rect )
I think it should paint document contents inside of view but it doesn't... in the place where it should be painted there is empty hole (i'm using QTextDocument::size and QTextDocument::setTextWidth to caclulate size hint). I know how to handle clicks on link with eventFilter etc. but i have no idea why it doesn't want to paint inside view. any ideas?
1. Item has element QTextDocument *doc;
2. doc contains HTML content ( i.e <a href="http://link">http://link</a>).
3. delegate accesses items doc and uses doc->drawContents( painter, option.rect )
I think it should paint document contents inside of view but it doesn't... in the place where it should be painted there is empty hole (i'm using QTextDocument::size and QTextDocument::setTextWidth to caclulate size hint). I know how to handle clicks on link with eventFilter etc. but i have no idea why it doesn't want to paint inside view. any ideas?