Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Unescaping HTML text in Qt/QML



  • Hi

    I have some QML Text objects which contain HTML escaped text. How can I obtain the plain, unformatted version of this text? Looking really for the opposite of Qt.escape().

    I have tried creating a QTextDocument, setting the escaped text with setHtml, then calling toPlainText(). This successfully removes HTML tags however, escaped text such as & ldquo; gets replaced with ?s.



  • QML supports JavaScript regular expressions. You can try with them.


Log in to reply