Posts

Showing posts with the label qt

Is there a better way to wordwrap text in QToolTip than just using RegExp?

Is there a better way to wordwrap text in QToolTip than just using RegExp? 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. This is relevant, you may care to vote: bugreports.qt.io/browse/QTBUG-41051 – Silicomancer Aug 7 '16 at 14:07 6 Answers 6 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 te...