Results 1 to 5 of 5

Thread: Display '<' as HTML in QString

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Display '<' as HTML in QString

    Quote Originally Posted by mclark View Post
    If I replace the '<' with &lt in the original example, "&lt" is displayed, not '<'.
    Because it should be "&lt;", not "&lt".

    Quote Originally Posted by mclark View Post
    A second question, can I display a QString with "<s>" or "<b>" or any other tag-like text in it and not have Qt treat it as HTML?
    No, HTML standard says that everything between < and > is a tag. Use &lt; and &gt; instead.

  2. The following user says thank you to jacek for this useful post:

    mclark (6th July 2007)

  3. #2
    Join Date
    Aug 2006
    Location
    Madison, WI USA
    Posts
    153
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    35
    Thanked 1 Time in 1 Post

    Default Re: Display '<' as HTML in QString

    Thanks jacek! I knew there had to be a way.

    Who knew that semi-colons could be so important

Similar Threads

  1. Is there a widget for display HTML files?
    By JeffJones in forum Newbie
    Replies: 6
    Last Post: 24th May 2007, 19:29
  2. QString static callback function from CURL
    By tpf80 in forum Qt Programming
    Replies: 12
    Last Post: 16th May 2007, 20:47
  3. Convert from iso-8859-1 to... Something else :-)
    By Nyphel in forum Qt Programming
    Replies: 4
    Last Post: 7th March 2007, 17:59
  4. Widget to display an HTML page ?
    By probine in forum Qt Tools
    Replies: 3
    Last Post: 11th October 2006, 18:55
  5. Converting QString to unsigned char
    By salston in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2006, 22:10

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
  •  
Qt is a trademark of The Qt Company.