From 3f35a5a48d557d87315783977d1e1f8da2471111 Mon Sep 17 00:00:00 2001 From: "Tux3 / Mlkj / !Lev.uXFMLA" Date: Tue, 9 Sep 2014 22:36:34 +0200 Subject: [PATCH] Fix #266 --- widget/chatareawidget.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/widget/chatareawidget.cpp b/widget/chatareawidget.cpp index e3d021dd7..9f8633b97 100644 --- a/widget/chatareawidget.cpp +++ b/widget/chatareawidget.cpp @@ -25,6 +25,7 @@ ChatAreaWidget::ChatAreaWidget(QWidget *parent) : setReadOnly(true); viewport()->setCursor(Qt::ArrowCursor); setContextMenuPolicy(Qt::CustomContextMenu); + setUndoRedoEnabled(false); } ChatAreaWidget::~ChatAreaWidget() @@ -82,7 +83,11 @@ void ChatAreaWidget::insertMessage(ChatAction *msgAction) return; messages.append(msgAction); - updateChatContent(); + //updateChatContent(); + + moveCursor(QTextCursor::End); + moveCursor(QTextCursor::PreviousCell); + insertHtml(msgAction->getHtml()); } void ChatAreaWidget::updateChatContent() @@ -90,7 +95,9 @@ void ChatAreaWidget::updateChatContent() QScrollBar* scroll = verticalScrollBar(); lockSliderToBottom = scroll && scroll->value() == scroll->maximum(); + setUpdatesEnabled(false); setHtml(getHtmledMessages()); + setUpdatesEnabled(true); if (lockSliderToBottom) sliderPosition = scroll->maximum();