From b05254e259940af7da7d80ee37822d4af44e7009 Mon Sep 17 00:00:00 2001 From: Msy-msu <2200456405@qq.com> Date: Sun, 8 Jan 2023 22:53:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E6=96=87=E4=BB=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TcpClient.pro.user | 2 +- mainwidget.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/TcpClient.pro.user b/TcpClient.pro.user index 0c81213..4f418f1 100644 --- a/TcpClient.pro.user +++ b/TcpClient.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/mainwidget.cpp b/mainwidget.cpp index 03c0394..41c6ecf 100644 --- a/mainwidget.cpp +++ b/mainwidget.cpp @@ -7,7 +7,7 @@ MainWidget::MainWidget(QString username,QWidget *parent) : { ui->setupUi(this); this->setWindowIcon(QIcon(":/icon.png")); - this->setWindowTitle("TCP聊天室"); + this->setWindowTitle(QString("TCP聊天室:%1").arg(username)); ui->name_list->setEditTriggers(QAbstractItemView::NoEditTriggers); //不允许编辑 ui->name_list->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); ui->name_list->verticalScrollBar()->setStyleSheet("QScrollBar{width:16px;}"); @@ -69,7 +69,7 @@ void MainWidget::on_send_text_clicked() void MainWidget::on_save_btn_clicked() { - QFile file("./txt/memory.txt"); + QFile file("./memory.txt"); if (file.exists()) //文件存在 { QMessageBox::StandardButton reply; @@ -105,7 +105,7 @@ void MainWidget::on_save_btn_clicked() else { - QMessageBox::warning(this, "提示", tr("打开文件失败,已为您自动创建文件!")); + QMessageBox::warning(this, "提示", tr("聊天记录文件不存在,已为您自动创建文件!")); file.open(QIODevice::WriteOnly | QIODevice::Append); } }