[SOLVED]: QTableView, highlight a part of a row
-
Hello,
I have a QTableView with the selection mode set to "row". I want to highlight only a part of the whole row, actually. Say, from column 2 to the end.I think I must subclass QTableView and reimplement the paint event. But I don't know how to fill the rectangle of the desired cells. Perhaps is there a more convenient way?
-
Yes, I'm talking when the user select a row (i.e. click on a cell of a row).
Otherwise I would use the Qt::background role in the model.The final goal is to prevent the highlight color to override the background of the first cell.
I mean, I want the first column maintains its own background even when the row is selected. -
Hi,
You can implement you own QStyledItemDelegate and avoid drawing the selection rectangle.