Details
-
Suggestion
-
Resolution: Done
-
P2: Important
-
4.7.1
-
None
-
695d85363e537b51b5d0ae6ab08a9a1e7d9e8354
Description
When setting the same value for DisplayRole and ToolTipRole, the tooltip can actually display very different text from the displayed text.
The reason for this is tooltip handling is implemented in QAbstractItemDelegate and uses a toString function to convert QVariant to QString. On the other hand, painting is implemented in QStyledItemDelegate and uses a custom displayText function to convert the QVariant value to QString. The results are very different for QDateTime values, as an example.
Simplest solution would be to override helpEvent in QStyledItemDelegate and use the displayText function there instead of the toString function.