Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. how to show html code as text in Qtextedit

how to show html code as text in Qtextedit

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 1.1k Views 1 Watching
  • 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.
  • U Offline
    U Offline
    UG SEP
    wrote on last edited by
    #1

    Hey, whenever I try to set text as HTML code in Qtextedit it changes that HTML code into HTML code result. So how can I show HTML source code to text edit...
    Thanks in advance
    Example: ui->textedit->settext("<strong>Html code</strong>");
    Output: Html code Expected Output: <strong>Html code</strong>

    JonBJ 1 Reply Last reply
    0
    • U UG SEP

      Hey, whenever I try to set text as HTML code in Qtextedit it changes that HTML code into HTML code result. So how can I show HTML source code to text edit...
      Thanks in advance
      Example: ui->textedit->settext("<strong>Html code</strong>");
      Output: Html code Expected Output: <strong>Html code</strong>

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by
      #2

      @UG-SEP
      QTextEdit::setAcceptRichText(false) and/or QTextEdit::setPlainText(yourText).

      1 Reply Last reply
      2
      • U Offline
        U Offline
        UG SEP
        wrote on last edited by
        #3

        Thanks a lot, @JonB I haven't think about this function.
        One again thanks

        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