From f1877951ba08cd3b4292dfbf391bf04a1fe21cf5 Mon Sep 17 00:00:00 2001 From: wumu <mayi@mayi.com> Date: 星期一, 25 八月 2025 23:36:35 +0800 Subject: [PATCH] 250825 --- analysisbyrediscache.cpp | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/analysisbyrediscache.cpp b/analysisbyrediscache.cpp index f9fff34..a917c7d 100644 --- a/analysisbyrediscache.cpp +++ b/analysisbyrediscache.cpp @@ -27,9 +27,13 @@ m_model = new QStandardItemModel(this); ui->tableView->setModel(m_model); + m_modelResult = new QStandardItemModel(this); + ui->tableView_2->setModel(m_modelResult); + QStringList labels; labels<<"鑲$エ鍚嶅瓧"<<"甯傚��"<<"鏀剁洏浠�"<<"娑ㄨ穼骞�"<<"鎺掑悕"<<"浜ゆ槗鏃堕棿"<<"鎺掑悕鍙樺寲"; m_model->setHorizontalHeaderLabels(labels); + m_modelResult->setHorizontalHeaderLabels(labels); } AnalysisByRedisCache::~AnalysisByRedisCache() @@ -99,6 +103,7 @@ int rank_val = 0; int cnt = 0; + int bigFlag = false; for(auto it:m_result){ if(it["name"].toString() == name){ // qDebug()<<it["name"].toString()<<it["close"].toString()<<it["amount_rank"].toString()<<it["time_trade"].toString(); @@ -132,6 +137,7 @@ QStandardItem * amount_rank_item = new QStandardItem(QString::number(rank_rate)); if(rank_rate > 0.9){ amount_rank_item->setData(QColor("red"),Qt::BackgroundColorRole); + bigFlag = true; } items.append(amount_rank_item); @@ -141,6 +147,17 @@ } m_model->appendRow(items); + if(bigFlag){ + QList<QStandardItem*> items_2; + for(int i=0;i<items.size();++i){ + items_2.append(new QStandardItem(items.at(i)->text())); + if(i==6 && items.at(i)->text().toDouble() > 0.95){ + items_2.back()->setData(QColor("red"),Qt::BackgroundColorRole); + } + } + m_modelResult->appendRow(items_2); + bigFlag = false; + } } } @@ -163,6 +180,7 @@ // 鎵归噺鍒嗘瀽 // 閲嶈妯″瀷鐨勮鏁颁负0锛屾竻绌轰竴涓嬫暟鎹� m_model->setRowCount(0); + m_modelResult->setRowCount(0); int batch_num = ui->comboBox_batchNum->currentText().toInt(); // 鎵归噺鍒嗘瀽涓偂鐨勬暟閲� // 鎷垮嚭涓偂浜ゆ槗棰濇帓鍚嶇殑鍓峃鍚嶏紝杩涜缂撳瓨鍒嗘瀽 -- Gitblit v1.8.0