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. setPlainText does not
Forum Updated to NodeBB v4.3 + New Features

setPlainText does not

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 207 Views 2 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by Chris Kawa
    #1

    The attached C++ code gets a QString "line" which includes control characters.
    Should "setPlainText" remove the control characters or am I reading the documentation wrong?

     line = stream.readLine();
     TRACE_TextEdit->setPlainText(line);
    
    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by Chris Kawa
      #2

      No, setPlainText only means that the input text is not interpreted as html and will not be formatted accordingly, so if you have e.g. <br> in your string it will display these characters as is and not change that to an actual line break.

      If you need to remove some unwanted characters from the string you have to do it on your own.

      1 Reply Last reply
      4

      • Login

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