PDA

View Full Version : Reading last lines from QTextEdit Document



qtnewbie6019
1st August 2015, 01:39
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?

kbsk007
6th August 2015, 06:37
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.