Results 1 to 2 of 2

Thread: Reading last lines from QTextEdit Document

  1. #1
    Join Date
    Mar 2013
    Posts
    12
    Qt products
    Platforms
    Windows

    Default Reading last lines from QTextEdit Document

    Hi I have a QtextEdit control, in which a user can type in text, what I want to do is read the last 100 lines of text that has been entered.
    i.e. whenever the user presses the [ENTER] key, I want to read/get the last 100 lines of text from the bottom of the QTextEdit control.
    Any suggestions on reading from the bottom of the QtextDocument?

  2. #2
    Join Date
    Aug 2015
    Posts
    20
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: Reading last lines from QTextEdit Document

    you split the text at the new line in a stringlist and the function size()
    shows you the number of lines, then you can read the last 100 lines.

Similar Threads

  1. QTextEdit with document template
    By golubevsv in forum Qt Programming
    Replies: 4
    Last Post: 9th September 2014, 22:39
  2. Replies: 9
    Last Post: 22nd February 2013, 13:27
  3. How to handle Large Immutable Document in QTextEdit
    By rcjohns in forum Qt Programming
    Replies: 1
    Last Post: 5th April 2010, 21:35
  4. Replies: 0
    Last Post: 9th March 2010, 14:02
  5. QTextEdit setCurrentFont() for entire document
    By sunil.thaha in forum Qt Programming
    Replies: 3
    Last Post: 9th August 2006, 08:53

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.