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
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.