Tooltips in QTableWidgetItem
Hello,
I would like my QTableWidgetItems (and headers) to have tooltips. Using the setToolTip method does not result in the fact that the tooltip is displayed when 'hovering'.
Apparently I missed something, but for instance buttons, etc it works. Could someone help me on this one?
Thanks,
Arthur
Re: Tooltips in QTableWidgetItem
Subclass QTableWidgetItem and reimplement data to return whatever text you want for Qt::ToolTipRole (3), like so:
Code:
public:
void setToolTip
(const QString &t
){ m_tooltip
= t;
} }
private:
};
Edit:
I just noticed there is a setData() member available for QTableWidgetItem, so all you have to do is to call setData(3, "My Tooltip");
Re: Tooltips in QTableWidgetItem
Thank you, that did the trick