Look at the basic code samples here where
readLine
is used:
http://lists.trolltech.com/qt-interest/2002-03/msg00576.html[
^].
In your case, you should keep the file opened. Read 100 lines each time you request to forward a page.
Unfortunately, scrolling your view back would be more difficult, because all likes can have different length, so you don't know file position of each line before you read all previous lines. You would need to index your file by 100-line chunks on the fly on first read, keeping the results in a hash table of file positions indexed by chunk indexes. It is fairly simple but will require some thinking during implementation. :-)
—SA