chatwidget.cpp 531 Bytes
#include "chatwidget.h"

ChatWidget::ChatWidget(QWidget *parent) :
    QTextEdit(parent)
{

}

void ChatWidget::printServerMsg(const string &str)
{
    this->append("<p style=\"font-style:italic;color:gray;line-height:25%;\">" + QString::fromStdString(str) + "</p>");
}

void ChatWidget::printMsg(const string &str)
{
    this->append(QString::fromStdString(str));
}

void ChatWidget::printStatusMsg(const string &str)
{
    this->append("<p style=\"font-weight:bold;line-height:25%;\">" + QString::fromStdString(str) + "</p>");
}