void Widget::on_pushButton_Add_clicked()
{
ui
->tableWidget
->setItem
(0,
0,
new QTableWidgetItem(ui
->lineEdit_UDPport
->text
()));
ui
->tableWidget
->setItem
(0,
1,
new QTableWidgetItem(ui
->lineEdit_DataName
->text
()));
ui
->tableWidget
->setItem
(0,
2,
new QTableWidgetItem(ui
->lineEdit_DataAddress
->text
()));
ui
->tableWidget
->setItem
(0,
3,
new QTableWidgetItem(ui
->comboBox_DataType
->currentText
()));
ui
->tableWidget
->setItem
(0,
4,
new QTableWidgetItem(ui
->lineEdit_DataLength
->text
()));
}
void Widget::on_pushButton_Add_clicked()
{
ui->tableWidget->setItem(0, 0, new QTableWidgetItem(ui->lineEdit_UDPport->text()));
ui->tableWidget->setItem(0, 1, new QTableWidgetItem(ui->lineEdit_DataName->text()));
ui->tableWidget->setItem(0, 2, new QTableWidgetItem(ui->lineEdit_DataAddress->text()));
ui->tableWidget->setItem(0, 3, new QTableWidgetItem(ui->comboBox_DataType->currentText()));
ui->tableWidget->setItem(0, 4, new QTableWidgetItem(ui->lineEdit_DataLength->text()));
}
To copy to clipboard, switch view to plain text mode
Bookmarks