Results 1 to 4 of 4

Thread: using settext() and sethtml() to display output in text browser at same time

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: using settext() and sethtml() to display output in text browser at same time

    You mean somehting like this?
    Qt Code:
    1. QString plainText("some plain\ntext");
    2. QString url("http://example.com");
    3. QString html = QString("<pre>%1</pre><a href='%2'>%2</a>").arg(plainText).arg(url);
    4. ui->textBrowser->setHtml(html);
    To copy to clipboard, switch view to plain text mode 

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

    huydo (15th June 2016)

Similar Threads

  1. Real time display of QProcess output in a textBrowser
    By Tanny007 in forum Qt Programming
    Replies: 2
    Last Post: 17th December 2015, 04:30
  2. How to display text from a file to a text browser
    By ironmantis7x in forum Newbie
    Replies: 11
    Last Post: 14th June 2012, 15:23
  3. display in text browser
    By mecrazycoder in forum Newbie
    Replies: 7
    Last Post: 13th December 2010, 16:49
  4. I don't get expected output in text browser
    By NewLegend in forum Qt Programming
    Replies: 14
    Last Post: 25th July 2010, 09:21
  5. Replies: 52
    Last Post: 10th December 2006, 14:32

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