PDA

View Full Version : QTextEdit and QString not showing straight brackets



Mr_Cloud
8th December 2015, 00:44
Hi everyone, I have a formatting problem. I made an IRC chat program which uses a QTextEdit as the main text area.

I am doing a simple append(QString) at the end, as opposed to insertPlainText(QString) and as such, commands such as <b> and <i> tags will turn the text in between them into bold and italic, respectively.

How do I get the text area to show a <3 for example? Anything after the first straight bracket is missing. What's the command to just display the straight bracket as a non-command character?

I tried having the straight bracket with a backslash in front, with quotes etc but nothing I tried seems to work.

Thanks in advance.

anda_skoa
8th December 2015, 11:00
&lt;
same as in HTML.

See also: QString::toHtmlEscaped()

Cheers,
_

Mr_Cloud
8th December 2015, 12:59
As always, thank you for the feedback and solution, anda_skoa. Until next time, auf wiedersehen.