PDA

View Full Version : textedit and inserthtml



mero
12th December 2009, 14:52
Hello,

I have texedit ..
and I change font size ...

textEdit->setFontPointSize(12);
and then everythink is ok, but if I add img

textEdit->insertHtml("<img src=\""+emoticonFull+"\" alt=\""+emoticon+"\" />");
then text font before img is ok but after img is not this size ... and how can I change font to 12 after img ?
I try:


int iRealFontSize = textEdit->fontWeight(); // fix
textEdit->insertHtml("<img src=\""+emoticonFull+"\" alt=\""+emoticon+"\" />");
textEdit->setFontWeight(iRealFontSize); // fix

but it is not working ....

Text before img and after I add by


textEdit->insertPlainText(QString(strData[i]));


Example:
http://img695.yfrog.com/img695/8138/bugc.png

mero
12th December 2009, 19:27
OK, I found solution:


QFont realfont = textEdit->currentFont();
....
textEdit->setCurrentFont(realfont);