改进代码
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user