Tooltip on QTableWidget header
Hi there,
is there an easy solution to get tooltips when hovering over headers in QTableWidget or QTableView widgets?
My solution would be a combination of QHelpEvent and some coordinate calculation using indexOf() in the QHeaderView to find the correct header/column, but this looks to complicated...
Thanks,
Andreas
Re: Tooltip on QTableWidget header
Did you try returning data for Qt::ToolTipRole from within your model in the headerData() method?
Re: Tooltip on QTableWidget header
And with QTableWidget you could use header items:
Code:
if (headerItem)
headerItem->setToolTip("Hello, world!");
Re: Tooltip on QTableWidget header
All these of course provided that either the header view or the basic view can handle it. QHeaderView is a very limited class when it comes to model/view features.
Re: Tooltip on QTableWidget header
Quote:
Originally Posted by
wysota
All these of course provided that either the header view or the basic view can handle it. QHeaderView is a very limited class when it comes to model/view features.
Yup, QHeaderView can handle tooltips out of the box.