This is a Newbie question so I'm in the right place to ask it.
I have a form with a QTableWidget in it, called tblMyTable.
I wrote this code to be executed when clicking on a push button:
ui.tblMyTable->setRowCount(10);
ui.tblMyTable->setColumnCount(3);
itm.setText("blabla");
ui.tblMyTable->setItem(1, 1, &itm);
ui.tblMyTable->setRowCount(10);
ui.tblMyTable->setColumnCount(3);
QTableWidgetItem itm(QString("blablabla"));
itm.setText("blabla");
ui.tblMyTable->setItem(1, 1, &itm);
To copy to clipboard, switch view to plain text mode
When running, my code creates the 10x3 table but there is no data in any of the cells.
Before I tried entering data directly using:
ui.tblMyTable->item(1, 1)->setText("boo");
ui.tblMyTable->item(1, 1)->setText("boo");
To copy to clipboard, switch view to plain text mode
but this resulted in a read access violation error.
Bookmarks