I display whole .txt file:
Qt Code:
  1. QFile fp("file.txt");
  2. fp.open(IO_ReadOnly);
  3. while (!fp.atEnd() ) {
  4. fp.readLine(buff, sizeof(buff));
  5. textEdit->append(buff);
  6. }
  7. fp.close();
To copy to clipboard, switch view to plain text mode 
but I would like to display last 20 lines or next to last 20 lines. How can I achive this?