改进代码

This commit is contained in:
feiyangqingyun
2021-08-21 16:10:36 +08:00
parent c4411c9b2e
commit 17c13cbf2f
7 changed files with 62 additions and 24 deletions

View File

@@ -7,6 +7,7 @@ frmTcpServer::frmTcpServer(QWidget *parent) : QWidget(parent), ui(new Ui::frmTcp
ui->setupUi(this);
this->initForm();
this->initConfig();
on_btnListen_clicked();
}
frmTcpServer::~frmTcpServer()
@@ -129,10 +130,13 @@ void frmTcpServer::append(int type, const QString &data, bool clear)
QString strType;
if (type == 0) {
strType = "发送";
ui->txtMain->setTextColor(QColor("darkgreen"));
} else {
ui->txtMain->setTextColor(QColor("#22A3A9"));
} else if (type == 1) {
strType = "接收";
ui->txtMain->setTextColor(QColor("red"));
ui->txtMain->setTextColor(QColor("#D64D54"));
} else {
strType = "信息";
ui->txtMain->setTextColor(QColor("#A279C5"));
}
strData = QString("时间[%1] %2: %3").arg(TIMEMS).arg(strType).arg(strData);