PDA

View Full Version : How to insert the blank row in table widget when click push button



hajh90
28th July 2019, 00:48
I created table widget, 3 rows and 6 columns using qt creator GUI, and it is placed on certain area of my GUI. Now, i want to insert blank row as 4th, 5th, 6th row continuously. I made slot to that push button, but i do not know what code i should use for it. Can anyone help me?
13205

I tried this code, but it is not working. pushbutton_12 is the add button name.

void MainWindow::on_pushButton_12_clicked()
{
int i = ui->tableWidget->rowCount();
ui->tableWidget->insertRow(i);

}

ChrisW67
28th July 2019, 02:03
What aspect of it is "not working"? The button slot is never called, a new row is not added, the new row is not added at the end...