i want to create an Qt application containing a table of 3 columns and n row, the user will choose the number of row by putting it in the edit button and the table will have 3 columns and the number given by the user. then fill it with element
i have search a lot but only found how to fill the able with sql data,
please is anybody having an idea?
here is what i did so far, i have fixed the number of rows and columns but it is not what i want, besides, i want to use either QtableWidget or QtavleViewItem
int n;
n = ui->spinBox->value();
QStandardItemModel *model = new QStandardItemModel(n,3,this); //2 Rows and 3 Columns
model->setHorizontalHeaderItem(0, new QStandardItem(QString("x")));
model->setHorizontalHeaderItem(1, new QStandardItem(QString("y")));
model->setHorizontalHeaderItem(2, new QStandardItem(QString("z")));
ui->tableView->setModel(model);