Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Unescaping HTML text in Qt/QML
QtWS25 Last Chance

Unescaping HTML text in Qt/QML

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 2 Posters 4.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    QtQueries
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      task_struct
      wrote on last edited by
      #2

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

      "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program."

      • Linu...
      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved