diff --git a/QChatClient/chatwidget.cpp b/QChatClient/chatwidget.cpp index 69f1809..d6aebab 100644 --- a/QChatClient/chatwidget.cpp +++ b/QChatClient/chatwidget.cpp @@ -11,7 +11,7 @@ void ChatWidget::printMsg(const string &str) this->setFontWeight(QFont::Normal); this->setFontItalic(false); this->setTextColor(Qt::black); - this->append(QString::fromStdString(str)); + this->append(QString::fromUtf8(str.c_str())); } void ChatWidget::printServerMsg(const string &str) diff --git a/QChatClient/chatwindow.cpp b/QChatClient/chatwindow.cpp index 56fc9aa..0903c93 100644 --- a/QChatClient/chatwindow.cpp +++ b/QChatClient/chatwindow.cpp @@ -26,7 +26,7 @@ ChatWindow::ChatWindow(QString nick, QWidget *parent) : void ChatWindow::notifyClose() { - emit ui->actionExit->triggered(); + this->close(); } void ChatWindow::notifyPrint(string &msg) @@ -49,7 +49,7 @@ void ChatWindow::printMsg(QString str) void ChatWindow::sendMsg() { - QString msg = ui->inputText->toPlainText(); + QString msg = ui->inputText->toPlainText().toUtf8(); ui->inputText->clear(); msg = "@" + nickName + " " +msg; ((Chatroom*)this->parent())->putMsgToSendQueue(msg);