[Qt-interest] Showing tool tips for elided text

Tony Rietwyk tony.rietwyk at rightsoft.com.au
Thu Apr 22 04:15:42 CEST 2010


Hi Everybody, 

In my application I use all three item widgets (QTreeWidget, etc).  They all seem to have the same problem.  When users see elided text (that is "Some text ..."), they expect to be able to hover over the text and see a tool tip with the full text displayed.  

At the moment, I simply check if the cell contents is longer than a fixed amount, then I set the tool tip in code.  This is not very satisfactory, especially if the widget is resizable.  There are also bugs, where the tool tip stays visible even when the user moves the mouse over other cells that don't have a tooltip set.  

I can't see any signal being emitted when text is elided, which makes sense, since the elision is done way down in the QPainter level.  Nor is there any method to query whether the text has been elided.  

How do others handle this?  

Thanks, 

Tony.





More information about the Qt-interest-old mailing list