diff --git a/log7.pro.user b/log7.pro.user index ef52d4d..ff420cd 100644 --- a/log7.pro.user +++ b/log7.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId @@ -99,7 +99,7 @@ Qt 5.12.0 (mingw73_64) Qt 5.12.0 (mingw73_64) {edc54fcd-f681-4a0a-ba77-11a1a5c94a66} - 1 + 0 0 0 @@ -255,7 +255,7 @@ true true true - C:/Work/CQT/Test_01/build-log7-Qt_5_12_0_mingw73_64-Release + C:/Work/CQT/Test_01/build-log7-Qt_5_12_0_mingw73_64-Debug 1 diff --git a/mainwindow.cpp b/mainwindow.cpp index dc68454..7069aa0 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -85,6 +85,7 @@ void MainWindow::addCombo(const QStringList &list) { ui->comboBox->addItems(list); //根据输入匹配下拉框 Gloab::completer = new QCompleter(list); + Gloab::completer->setFilterMode(Qt::MatchContains); ui->comboBox->setCompleter(Gloab::completer); } diff --git a/qcustplot.cpp b/qcustplot.cpp index d2cf850..957802c 100644 --- a/qcustplot.cpp +++ b/qcustplot.cpp @@ -35,6 +35,9 @@ QCustPlot::QCustPlot(QVector xData, QVector yData, int jd, bool QSharedPointer textTicker(new QCPAxisTickerText); textTicker->addTicks(ticks, labels); ui->plot->yAxis->setTicker(textTicker); + }else{ + ui->plot->yAxis->setNumberFormat("f"); + ui->plot->yAxis->setNumberPrecision(2); } // 添加图形 diff --git a/threadread.cpp b/threadread.cpp index 37e8f11..f8aae66 100644 --- a/threadread.cpp +++ b/threadread.cpp @@ -5,11 +5,19 @@ threadRead::threadRead(QObject *parent) } bool threadRead::isNumeric(QString data) { + bool flag = false; // 正则表达式匹配数字和可选的正负号 QRegularExpression pattern("^[+-]?([1-9][0-9]*|0)[.]?[0-9]*$"); QRegularExpressionMatch patternMatch =pattern.match(data); - // 使用std::regex_match来检查字符串是否完全匹配模式 - return patternMatch.hasMatch(); + if(patternMatch.hasMatch()){ + flag = true; + } + QRegularExpression kexue("^[0-9].[0-9]e[+-][0-9][0-9]"); + QRegularExpressionMatch kexueMatch =kexue.match(data); + if(kexueMatch.hasMatch()){ + flag = true; + } + return flag; } void threadRead::run() {