I haven't tested with QTableWidget, but I know that with QListWidget there's a much better solution than using QListWidget::itemChanged and trying to block all the signals when adding/changing colors/setting flags, and doing anything else that "changes" the item.

Try this...

Qt Code:
  1. connect(ui.pTblItems->itemDelegate(), &QAbstractItemDelegate::commitData, this, &MyWidget::OnTblItemsCommitData);
To copy to clipboard, switch view to plain text mode 

Then implement the slot like this...

Qt Code:
  1. void MyWidget::OnTblItemsCommitData(QWidget* pLineEdit)
  2. {
  3. QString strNewText = reinterpret_cast<QLineEdit*>(pLineEdit)->text();
  4. int nRow = ui.pTblItems->currentRow();
  5. // do whatever you need here....
  6. }
To copy to clipboard, switch view to plain text mode 

Like I said... I only tried this for QListWidget, so who knows it might not work at all for the table widget, but the two classes are pretty similar so I wouldn't be surprised if it worked. You might have to tweak that code a bit to make it table widget specific.