In order to simulate a right click within a table cell with qtest::mouseclick I need to get a QWidget* pointer from that cell.

The cell is from a QTableView so I do not have the "cellWidget" function that I used to have with QTableWidget. The view has custom delegates, so using a QModelIndex I can retrieve the delegates. indexWidget(...) allways returns 0.

My problem is that I need the QWidget* of the cell being displayed (not the editor widget). I am confused because a delegate is a QObject and not a QWidget.

So to make this question easy:

How can I get the QWidget* for the cell of a table view (not the editor widget) ???