Results 1 to 5 of 5

Thread: New Line in textBrowser

  1. #1
    Join Date
    Jul 2010
    Posts
    71
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default New Line in textBrowser

    Hello to all

    How do I put a new line and a space in output textBrowser ???
    Last edited by NewLegend; 11th August 2010 at 07:14.

  2. #2
    Join Date
    Jul 2010
    Location
    France
    Posts
    18
    Thanks
    2
    Qt products
    Qt4 Qt Jambi
    Platforms
    Unix/X11 Windows

    Default Re: New Line in textBrowser

    Have you try
    Qt Code:
    1. \n
    To copy to clipboard, switch view to plain text mode 
    or
    Qt Code:
    1. </br>
    To copy to clipboard, switch view to plain text mode 
    ?

  3. #3
    Join Date
    Apr 2010
    Location
    Rostov-na-Donu, Russia
    Posts
    153
    Thanks
    2
    Thanked 26 Times in 23 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: New Line in textBrowser

    Qt Code:
    1. <br>
    To copy to clipboard, switch view to plain text mode 
    for new line and
    Qt Code:
    1. & n b s p ;
    To copy to clipboard, switch view to plain text mode 
    for space but without spaces inside

  4. #4
    Join Date
    Jul 2010
    Posts
    71
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: New Line in textBrowser

    not work
    ui->textBrowser_8->setText( "Sum = " + resultString.setNum(ptr->t) + \n );

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

    Default Re: New Line in textBrowser

    Of course not, that won't even compile.

    Here's a couple to try:
    Qt Code:
    1. ui->textBrowser_8->setPlainText( "Sum = " + resultString.setNum(ptr->t) + "\n" );
    2. ui->textBrowser_8->setHtml( "Sum = " + resultString.setNum(ptr->t) + "<br/>" );
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. setting html for textbrowser
    By addu in forum Qt Programming
    Replies: 8
    Last Post: 9th October 2009, 07:16
  2. Drawing text within rectangular in textbrowser
    By addu in forum Qt Programming
    Replies: 4
    Last Post: 21st September 2009, 06:21
  3. Showing picture on textbrowser
    By anafor2004 in forum Qt Programming
    Replies: 1
    Last Post: 26th April 2008, 17:09
  4. Textbrowser issue
    By deekayt in forum Qt Programming
    Replies: 1
    Last Post: 29th October 2006, 07:51
  5. How to display a file in the textBrowser
    By deekayt in forum Qt Programming
    Replies: 2
    Last Post: 26th October 2006, 19:47

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.