Sounds great, but I get some runtime error:
QPainter::begin: Paint device returned engine == 0, type: 2 QWidget::render: Cannot render with an inactive painterEdit:
There is some modification on your suggested code neccessary:
But anyhow it renders the cell of one index above the selected one.
Maybe that has something to do with the offset parameter (second one in render).
Edit2:
The proper QRect can be calculated with the height of the horizontal header: