[CHANGE] UI Layout

This commit is contained in:
guzz 2024-11-05 17:00:41 +08:00
parent bfee5f9d49
commit 27f3def00a
4 changed files with 18872 additions and 19211 deletions

View File

@ -49,7 +49,7 @@ void AppSerial::setHWND(HWND hwnd)
this->m_hwnd = hwnd;
}
bool AppSerial::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result)
bool AppSerial::nativeEventFilter(const QByteArray &eventType, void *message, long *result)
{
Q_UNUSED(eventType);
Q_UNUSED(result);

View File

@ -33,7 +33,7 @@ public:
void setHWND(HWND hwnd);
protected:
bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result);
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result);
signals:
/**

View File

@ -159,20 +159,20 @@ void MainWindow::init()
ui->pageDebugTextBrowser->clear();
});
connect(ui->pageDebugCheckBoxSaveLog, &QCheckBox::stateChanged, this, [=]{
if(ui->pageDebugCheckBoxSaveLog->isChecked()) {
pageDebugLogFlag = true;
QString filename = QFileDialog::getSaveFileName(this, "Save log", "Communication log", "Log Files (*.txt);;All Files (*)");
logFile = new QFile(filename);
if (logFile->open(QIODevice::Append | QIODevice::Text)) {
// connect(ui->pageDebugCheckBoxSaveLog, &QCheckBox::stateChanged, this, [=]{
// if(ui->pageDebugCheckBoxSaveLog->isChecked()) {
// pageDebugLogFlag = true;
// QString filename = QFileDialog::getSaveFileName(this, "Save log", "Communication log", "Log Files (*.txt);;All Files (*)");
// logFile = new QFile(filename);
// if (logFile->open(QIODevice::Append | QIODevice::Text)) {
}
}
else {
pageDebugLogFlag = false;
logFile->close();
}
});
// }
// }
// else {
// pageDebugLogFlag = false;
// logFile->close();
// }
// });
//初始化batt
bat = new batt();
@ -194,13 +194,13 @@ void MainWindow::init()
// sglChartInit(7);
// ui->groupBox_color_sgl->setStyleSheet("QGroupBox { border: none; }");
// ui->scrollArea_sgl_charts->setFrameShape(QFrame::NoFrame);
ui->scrollAreaChart->setFrameShape(QFrame::NoFrame);
// ui->scrollAreaChart->setFrameShape(QFrame::NoFrame);
ui->scrollAreaChart->setStyleSheet("background-color: #FFFFFF;"); //设置背景颜色为纯白色
// ui->scrollAreaChart->setStyleSheet("background-color: #FFFFFF;"); //设置背景颜色为纯白色
ui->widgetControl->setStyleSheet("background-color: #FFFFFF;");
ui->groupBox->setStyleSheet("background-color: #FFFFFF;");
ui->groupBox_trouble_control->setStyleSheet("background-color: #FFFFFF;");
ui->groupBox_chart->setStyleSheet("background-color: #FFFFFF;");
// ui->groupBox_chart->setStyleSheet("background-color: #FFFFFF;");
ui->groupBox_class_color->setStyleSheet("QGroupBox { border: none; }");
ui->BCU_DIDO->setStyleSheet("background-color: #FFFFFF;");
@ -1169,6 +1169,7 @@ void MainWindow::setMenuStyle()
void MainWindow::slot_pageDebugDisplayMessage(QByteArray byteArray, int dataType)
{
qDebug("#1");
if(ui->pageDebugCheckBoxDisplay->isChecked() == true) {
QString timeStr = QString(QDateTime::currentDateTime().toString("[yyyy-MM-dd hh:mm:ss.zzz] "));
QString tmpStr;
@ -1185,12 +1186,12 @@ void MainWindow::slot_pageDebugDisplayMessage(QByteArray byteArray, int dataType
else {
showStr = "<html><span body><span style=\"color:blue;\">Rx: </span></span body></html>" + tmpStr;
}
if(pageDebugLogFlag == true) {
if(logFile->isOpen()) {
QTextStream textStream(logFile);
textStream << timeStr + "Rx: " + tmpStr + '\n';
}
}
// if(pageDebugLogFlag == true) {
// if(logFile->isOpen()) {
// QTextStream textStream(logFile);
// textStream << timeStr + "Rx: " + tmpStr + '\n';
// }
// }
}
else if(dataType == TypeSendData) {
if(ui->pageDebugCheckBoxStarmp->isChecked()) {
@ -1199,16 +1200,17 @@ void MainWindow::slot_pageDebugDisplayMessage(QByteArray byteArray, int dataType
else {
showStr = "<html><span body><span style=\"color:orange;\">Tx: </span></span body></html>" + tmpStr;
}
if(pageDebugLogFlag == true) {
if(logFile->isOpen()) {
QTextStream textStream(logFile);
textStream << timeStr + "Rx: " + tmpStr + '\n';
}
}
// if(pageDebugLogFlag == true) {
// if(logFile->isOpen()) {
// QTextStream textStream(logFile);
// textStream << timeStr + "Rx: " + tmpStr + '\n';
// }
// }
}
ui->pageDebugTextBrowser->append(showStr);
}
qDebug("#2");
}
void MainWindow::slot_pageHomeSglDataMessage(QByteArray byteArray, int dataType)

File diff suppressed because it is too large Load Diff