| | |
| | | #include <QPushButton> |
| | | #include <QSqlQuery> |
| | | |
| | | extern int g_comId; |
| | | |
| | | ProblemCount::ProblemCount(QWidget *parent) : |
| | | QMainWindow(parent), |
| | | ui(new Ui::ProblemCount) |
| | | { |
| | | ui->setupUi(this); |
| | | ui->tableWidget->setColumnWidth(0,300); |
| | | m_comId = 1; |
| | | m_comId = g_comId; |
| | | for(int i=0;i<ui->tableWidget->rowCount();++i){ |
| | | QPushButton *btn = new QPushButton("上传",this); |
| | | ui->tableWidget->setCellWidget(i,3,btn); |
| | |
| | | values += QString("('%1','%2',%3,'%4',%5),").arg(ui->tableWidget->item(i,0)->text()) |
| | | .arg(ui->tableWidget->item(i,1)->text()).arg(ui->tableWidget->item(i,2)->text().toInt()) |
| | | .arg(ui->tableWidget->item(i,4)->text()) |
| | | .arg(m_comId); |
| | | .arg(g_comId); |
| | | } |
| | | values = values.left(values.length()-1); |
| | | QString sql = QString("insert into problem_count (kpi_name,code,num,evidences,com_id) values %1").arg(values); |