I need to display an HTML text:
QString text="<b>Hello</b>";
QMessageBox::information(this,"info", text);
The text is displayed as bold "Hello". How to display it as it is, i.e.,
<b>Hello</b>
Thanks!
You have to use the method toHtmlEscaped()
of QString
:
QString text="<b>Hello</b>";
QMessageBox::information(this, "info", text.toHtmlEscaped());