I want to display a tooltip for QTreeWidgetItem
that's hovered. However, getting a tooltip is not a very fast process in my case, so I don't want to call setTooltip()
for every single item. I want to do it on demand, on some event or signal. What's the easiest way to do it?
The best solution I've found is to subclass QTreeWidgetItem
, override virtual QVariant data(int column, int role) const;
and return a tooltip for this item when data
is called for Qt::ToolTipRole
.