|
1
2
3
4
5
6
7
8
|
#include "chatwidget.h"
ChatWidget::ChatWidget(QWidget *parent) :
QTextEdit(parent)
{
}
|
|
9
|
void ChatWidget::printServerMsg(const string &str)
|
|
10
|
{
|
|
11
|
this->append("<p style=\"font-style:italic;color:gray;line-height:25%;\">" + QString::fromStdString(str) + "</p>");
|
|
12
13
|
}
|
|
14
|
void ChatWidget::printMsg(const string &str)
|
|
15
|
{
|
|
16
|
this->append(QString::fromStdString(str));
|
|
17
18
|
}
|
|
19
|
void ChatWidget::printStatusMsg(const string &str)
|
|
20
|
{
|
|
21
|
this->append("<p style=\"font-weight:bold;line-height:25%;\">" + QString::fromStdString(str) + "</p>");
|
|
22
|
}
|