PDA

View Full Version : QListView drawing text including smileys



zgulser
1st April 2014, 21:15
Hi all,

I have a chat program and I don't know how to display strings like "Hello :-)". You see I want to display it like "Hello :)". To do so, I need do sort of smilify the text content. I've found and used the following but couldn't make it work.


QTextDocument *doc = new QTextDocument();
doc->setHtml(textMessage);
doc->drawContents(painter, messageRect);

I've attached my delegate class for you to analyze if you want.

Regards.

zgulser
2nd April 2014, 09:12
Correction: it displays the smilified string but in different place. I guess I'm messing with rect that I'm drawing it.