PDA

View Full Version : My derived TableView - how to get data mouse is over



steg90
17th May 2007, 08:45
Hi,

I have promoted a TableView widget to my own custom widget. I override the QAbstractItemView::viewportEvent in order to capture tooltips. What I want to do now is to display a QToolTip when this event is raised, but want to know how to get the item I am hovering over in the table, this possible?

Regards,
Steve

steg90
17th May 2007, 08:49
Hi,

I can work out the mouse position using QHelpEvent pos method, but how can I get the row, col within the table view?

Thanks,
Steve

jpn
17th May 2007, 08:50
QAbstractItemView::indexAt()

steg90
17th May 2007, 09:09
Thanks JPN, so obvious!