Hi all!
I need to populate a tablewidget from a datebase but I can't seem to do it. I have more experience with treewidgets but for this project I want tablewidgets.
I still don't have much code because I can't do the basic, like add a row..
The QTableWidget was added directly from the tool box and has 7 Columns and 0 Rows as default.
I looked up some examples but they didn't work. Is this wrong:
item->setText("test");
int n = ui->tableWidget->rowCount();
ui->tableWidget->setRowCount(n);
ui->tableWidget->setItem(n,0,item);
ui->tableWidget->setCellWidget(n,1,test);
QLineEdit *test = new QLineEdit;
QTableWidgetItem *item = new QTableWidgetItem;
item->setText("test");
int n = ui->tableWidget->rowCount();
ui->tableWidget->setRowCount(n);
ui->tableWidget->setItem(n,0,item);
ui->tableWidget->setCellWidget(n,1,test);
To copy to clipboard, switch view to plain text mode
thanks!
Bookmarks