Results 1 to 3 of 3

Thread: QTextEdit and QString not showing straight brackets

  1. #1
    Join Date
    Apr 2012
    Posts
    38
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Question QTextEdit and QString not showing straight brackets

    Hi everyone, I have a formatting problem. I made an IRC chat program which uses a QTextEdit as the main text area.

    I am doing a simple append(QString) at the end, as opposed to insertPlainText(QString) and as such, commands such as <b> and <i> tags will turn the text in between them into bold and italic, respectively.

    How do I get the text area to show a <3 for example? Anything after the first straight bracket is missing. What's the command to just display the straight bracket as a non-command character?

    I tried having the straight bracket with a backslash in front, with quotes etc but nothing I tried seems to work.

    Thanks in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTextEdit and QString not showing straight brackets

    &lt;
    same as in HTML.

    See also: QString::toHtmlEscaped()
    Cheers,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    Mr_Cloud (8th December 2015)

  4. #3
    Join Date
    Apr 2012
    Posts
    38
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTextEdit and QString not showing straight brackets

    As always, thank you for the feedback and solution, anda_skoa. Until next time, auf wiedersehen.

Similar Threads

  1. Highlight open & close brackets in QTextEdit
    By prasad_N in forum Newbie
    Replies: 2
    Last Post: 9th August 2015, 11:27
  2. Replies: 6
    Last Post: 26th August 2014, 23:50
  3. Som problems about unicode,QString and QTextEdit
    By furskytl in forum Qt Programming
    Replies: 2
    Last Post: 28th October 2011, 15:21
  4. QStringList straight to file
    By freak in forum Newbie
    Replies: 2
    Last Post: 13th June 2006, 23:38
  5. Replies: 4
    Last Post: 10th May 2006, 23:37

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.