Results 1 to 2 of 2

Thread: read QTextBrowser line by line

  1. #1
    Join Date
    Oct 2009
    Posts
    90
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default read QTextBrowser line by line

    hello,

    how can I read QTextBrowser line by line?

    regards
    navid

  2. #2
    Join Date
    Jan 2010
    Posts
    73
    Thanks
    6
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: read QTextBrowser line by line

    The best that I can figure, is that you extract ALL of the text using the plainText property (see http://qt.nokia.com/doc/4.6/qtextedi...plainText-prop), and then drop this into say a QTextStream. Something like this totally untested code:
    Qt Code:
    1. QString s = edit.plainText;
    2. QTextStream is(&s);
    To copy to clipboard, switch view to plain text mode 
    Now, read text line by line from the text stream.

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

    navid (1st March 2010)

Similar Threads

  1. How to read and write line by line?
    By Alex Snet in forum Qt Programming
    Replies: 3
    Last Post: 28th November 2010, 15:49
  2. Line spacing in QTextEdit/QTextBrowser
    By Valheru in forum Qt Programming
    Replies: 5
    Last Post: 10th November 2010, 13:47
  3. QTextBrowser Grab Last Line Of Output
    By crisp in forum Qt Programming
    Replies: 4
    Last Post: 11th October 2008, 13:13
  4. How to read line from file
    By Krishnacins in forum Newbie
    Replies: 10
    Last Post: 1st June 2006, 23:14
  5. QTextBrowser with line numbers
    By sreedhar in forum Qt Programming
    Replies: 1
    Last Post: 3rd April 2006, 13:23

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.