QTfrontend/chatwidget.cpp
changeset 1587 b8a3d449bed7
parent 1584 90f6a5abad17
child 1588 0988ae7771d3
--- a/QTfrontend/chatwidget.cpp	Tue Jan 06 14:18:09 2009 +0000
+++ b/QTfrontend/chatwidget.cpp	Tue Jan 06 14:29:34 2009 +0000
@@ -22,6 +22,7 @@
 #include <QLineEdit>
 #include <QAction>
 #include <QApplication>
+#include <QTextDocument>
 
 #include "chatwidget.h"
 
@@ -74,6 +75,18 @@
 	if (chatStrings.size() > 250)
 		chatStrings.removeFirst();
 	
+	chatStrings.append(Qt::escape(str));
+	
+	chatText->setHtml(chatStrings.join("<br>"));
+
+	chatText->moveCursor(QTextCursor::End);
+}
+
+void HWChatWidget::onServerMessage(const QString& str)
+{
+	if (chatStrings.size() > 250)
+		chatStrings.removeFirst();
+	
 	chatStrings.append(str);
 	
 	chatText->setHtml(chatStrings.join("<br>"));