Hi, I've done reading from QTableWidget cells:

Qt Code:
  1. QTableWidgetItem *itab = tableWidget->item(0,0);
  2. 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:

Qt Code:
  1. itab->setText("X");
  2. tableWidget->setItem(0, 0, itab);
To copy to clipboard, switch view to plain text mode 


Result (during running the program (compilation OK)):



_____

Code:

Qt Code:
  1. itab->setText("X");
  2. 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 ?