Results 1 to 2 of 2

Thread: QTextEdit and Html

  1. #1
    Join Date
    May 2008
    Posts
    276
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QTextEdit and Html

    Strange problem here.
    I have
    Qt Code:
    1. QString render = "<table width=\"100%\" border=0 cellspacing=0>\n"
    2. "<tr><td height=\">eee </td></tr></table>";
    3.  
    4. render += "</table>";
    5.  
    6.  
    7. detailsText->setHtml(render);
    To copy to clipboard, switch view to plain text mode 

    detailsText is just a QTextEdit widget.
    But nothing appear in the widget.
    If i put it with setPlainText() it is ok.
    Why

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QTextEdit and Html

    Qt Code:
    1. If i put it with setPlainText() it is ok.
    To copy to clipboard, switch view to plain text mode 
    What does "ok" mean here?

    Qt Code:
    1. <td height=\">
    To copy to clipboard, switch view to plain text mode 
    Is not correct HTML. Maybe fixing that helps.
    Also, note that you add 2 </table> closing tags.

    If not, try wrapping the text in <html> tags.

    HTH

Similar Threads

  1. Load HTML to QTextEdit
    By Gamalof in forum Qt Programming
    Replies: 2
    Last Post: 5th July 2008, 18:08
  2. put html text into a qtextedit
    By dreamer in forum Qt Programming
    Replies: 2
    Last Post: 8th May 2008, 19:44
  3. Loading images in html in a QTextBrowser
    By BasicPoke in forum Newbie
    Replies: 1
    Last Post: 6th June 2007, 21:51
  4. QTextEdit produces incorrect html
    By ccf_h in forum Qt Programming
    Replies: 5
    Last Post: 8th February 2006, 15:18
  5. [Qt 4.1]using html in QTextEdit from designer
    By patcito in forum Qt Programming
    Replies: 5
    Last Post: 16th January 2006, 22:36

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.