Fix ChatWidget last cursor formatting.

To test it, search a text that will be colored a end.
New messages lose their format.
This commit is contained in:
Phenom 2015-08-22 17:38:35 +02:00
parent eb4313fef2
commit 326a33059d

View File

@ -888,7 +888,9 @@ void ChatWidget::addChatMsg(bool incoming, const QString &name, const QDateTime
formatMsg.prepend(QString("<a name=\"%1_%2\"/>").arg(timeStamp).arg(name));
//To call this anchor do: ui->textBrowser->scrollToAnchor(QString("%1_%2").arg(timeStamp).arg(name));
ui->textBrowser->textCursor().setBlockFormat(QTextBlockFormat ());
QTextCursor textCursor = QTextCursor(ui->textBrowser->textCursor());
textCursor.movePosition(QTextCursor::End);
textCursor.setBlockFormat(QTextBlockFormat ());
ui->textBrowser->append(formatMsg);
if (ui->leSearch->isVisible()) {