internal_system_v1/problemnotmoney.cpp
@@ -6,9 +6,19 @@ ui(new Ui::ProblemNotMoney) { ui->setupUi(this); ui->tableWidget->setColumnWidth(0,300); } ProblemNotMoney::~ProblemNotMoney() { delete ui; } void ProblemNotMoney::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))); }