Hi, I've done reading from QTableWidget cells:
QTableWidgetItem *itab = tableWidget->item(0,0);
QString itabtext = itab->text();
To copy to clipboard, switch view to plain text mode
But i tried to make writing to QTableWidget cells:
I tried many ways, for example:
_____
Code:
itab->setText("X");
tableWidget->setItem(0, 0, itab);
QTableWidgetItem *itab;
itab->setText("X");
tableWidget->setItem(0, 0, itab);
To copy to clipboard, switch view to plain text mode
Result (during running the program (compilation OK)):

_____
Code:
itab->setText("X");
tableWidget->setItem(0, 0, itab->text());
QTableWidgetItem *itab;
itab->setText("X");
tableWidget->setItem(0, 0, itab->text());
To copy to clipboard, switch view to plain text mode
Result (during compilation):

Of course it's logical, because setItem needs QTableWidgetItem as third parameter, unfortunately not QString
.
Can someone help me how to write "X" into (0,0) cell ?
Bookmarks