So instead of a QTableWidgetItem, i have to try it with a AbstractItemDelegate ?
QTableWidget / QTableWidgetItem are there for convenience, when you just want to display text or something else that is simple, so you don't have to go to the work of using a QTableView and QAbstractTableModel. If you want something fancier than what QTableWidgetItem can do, you probably need a delegate. Look at the Stars Delegate example for how to implement customized painting for a cell that persists after the user has stopped editing the cell.


If your table is display- (read-) only (or the cells you want to highlight are display only), then you may be able to use a cell widget (QTableWidget::setCellWidget()) containing a QLabel. QLabel inherits from QFrame, which allow you to place a border around it.