How to get a Cell's coordinates in the delegate's painter by index/ column/row?

157 Views Asked by At

Note, I'm not asking about the current cell. I'm asking about getting some OTHER cell's position by row and column.

I've set a delegate for my Qtableview to handle graphics.

Inside my paint (self, painter: QPainter, option, index: QModelIndex): I know that I can access that current cell's location using option.rect.

I'm looking to get the rect in ANOTHER cell.

I know I can get the other cell's index using index.model().index (anotherR, anotherC) but I don't know how to get the 'option' (QstyleOptionViewItem) for that other cell.

I'm using Pyqt5 is that matters.

0

There are 0 best solutions below