So the question is in the title. QToolTip doesn’t seem to provide the wordwraop feature. It is possible, however, to replace the Nth space with an \n using regexps, but I was wondering if anyone has a suggestion for a better sollution.
Specifically, my problem with my approach is that it doesn’t take the length of text into account. For example I’d like longer texts to form wider paragraphs.
So the question is in the title. QToolTip doesn’t seem to provide the wordwraop
Share
If the text in a tooltip is rich text, it is automatically word-wrapped.
Here’s a trivial example, where setting the font to black makes it “rich text” and so it gets word wrapped. Leaving out the font declarations means the tooltip will be plain text and extend the whole length of the screen.
Of course with this example, the width of the tooltip is up to the platform.
There is a new suggestion in the Qt bug tracker about this problem: https://bugreports.qt.io/browse/QTBUG-41051. It also requests width to be changeable.