View Full Version : QTextCharFormat::WaveUnderline doesn't work

24th April 2008, 14:00
Hello! I'm trying to underline some text with a waved line. Here is my code:

f = cr.blockCharFormat ();
f.setUnderlineStyle (QTextCharFormat::WaveUnderline);
f.setUnderlineColor (Qt::red);
f.setFontUnderline (true);
cr.mergeCharFormat (f);
textEdit->setTextCursor (cr);
Underlining work well, but I see just a plain, non-waved line (QTextCharFormat::SingleUnderline). The same thing happens with QTextCharFormat::SpellCheckUnderline and other underlingg styles - just the QTextCharFormat::SingleUnderline works in all cases.

22nd April 2011, 17:36
setFontUnderline actually overwrites the underline style, simply remove that call, setUnderlineStyle is sufficient