Theoretically, this is very simple, but people will not write code for you from scratch.
1) You will need to use void QTableWidgetItem::setFlags(Qt::ItemFlags flags)
to make items editable and non-editable. You can use this method for each item as you wish.
See the following enumeration value description from the documentation of Qt::ItemFlags
:
Qt::ItemIsEditable 2 It can be edited.
2) Once that is done, you need to connect your custom slot to the corresponding signal of an item that has just been edited. Your slot would then rearrange the editable feature of the cells respectively.
Here are the relevant signals that may be of interest for you:
* void QTableWidget::cellChanged(int row, int column) [signal]
* void QTableWidget::currentCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn) [signal]
* void QTableWidget::currentItemChanged(QTableWidgetItem * current, QTableWidgetItem * previous) [signal]
* void QTableWidget::itemChanged(QTableWidgetItem * item) [signal]
Then, you will need something like this:
connect(myQTableWidgetSubclass, SIGNAL(selectedSignalFromAbove), this, SLOT(mySlotInTheClass));
// ...
void MyClass::mySlotInTheClass(...)
{
// ...
myTableWidgetItemX.setFlags(...);
// ...
}