Display tool tip on mouse hover of TableView

c++, qt

Solution

There is no built-in signal for that in the views, but instead the views support tooltips on items out-of-the-box if enabled in the model.

In your model, make sure to return the tooltip when it gets called with `Qt::ToolTipRole` in data().

If you use `QStandardItemModel` instead of your own model, there are various ways to achieve the same. One example would be `QStandardItem::setToolTip()`, another is `QStandardItemModel::setItemData()`.

Problem

Is there any signal that of tableview that return the row over which the mouse is hovered over. I would like to display the contents of a cell in a tool tip when the mouse is over a certain row.

Original source