diff --git a/src/chatwindow.cpp b/src/chatwindow.cpp
index 4946160..1380326 100644
--- a/src/chatwindow.cpp
+++ b/src/chatwindow.cpp
@@ -31,7 +31,8 @@ void ChatWindow::sendMessage(QString msgText)
jSend["chatID"] = chatID;
jSend["msgText"] = msgText;
network->sendDatagram(jSend, peerID);
- ui->chatEdit->append(tr("You: ") + msgText);
+ QDateTime date(QDateTime::currentDateTime());
+ ui->chatEdit->append("[" + date.toString() + "] " + tr("You: ") + msgText);
}
void ChatWindow::sendMsgButtonClicked()
@@ -43,7 +44,8 @@ void ChatWindow::sendMsgButtonClicked()
void ChatWindow::displayMsg(QString msgText)
{
- ui->chatEdit->append("" + peerID + "" + ": " + msgText);
+ QDateTime date(QDateTime::currentDateTime());
+ ui->chatEdit->append("[" + date.toString() + "] " + "" + peerID + "" + ": " + msgText);
}
void ChatWindow::leftFromChat()