From b8a40381a1136f00f417af5cf1041f1321d597ca Mon Sep 17 00:00:00 2001 From: wumu <mayi@mayi.com> Date: 星期四, 01 六月 2023 22:57:44 +0800 Subject: [PATCH] 0601 --- internal_system_v1/problemrectification.cpp | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/internal_system_v1/problemrectification.cpp b/internal_system_v1/problemrectification.cpp index 146dcb4..b013cad 100644 --- a/internal_system_v1/problemrectification.cpp +++ b/internal_system_v1/problemrectification.cpp @@ -6,9 +6,19 @@ ui(new Ui::ProblemRectification) { ui->setupUi(this); + ui->tableWidget->setColumnWidth(0,300); } ProblemRectification::~ProblemRectification() { delete ui; } + +void ProblemRectification::on_tableWidget_clicked(const QModelIndex &index) +{ + int allCnt = 0; + for(int i=1;i<ui->tableWidget->rowCount();++i){ + allCnt += ui->tableWidget->item(i,2)->text().toInt(); + } + ui->tableWidget->setItem(0,2,new QTableWidgetItem(QString::number(allCnt))); +} -- Gitblit v1.8.0